I’m simply trying to view my app in a browser via the IP address. I’m new to docker. I’ve spent a fair amount of time today trying to figure this out, but need a little help.
I have a docker container locally running a silverstripe app. Ive set this container up on a droplet using the marketplace/docker image. The app seems to all be setup and running as it should.
I have a docker-compose.yml file - the top looks like this:
version: "3.5"
services:
myname-www:
build:
context: .docker/www
dockerfile: Dockerfile
container_name: myname-www
ports:
- "${WWW_HTTP_PORT}:80"
- "${WWW_HTTPS_PORT}:443"
this is sitting in the project folder: /var/myname
and in an .env file I have these lines:
# Docker Configuration
WWW_HTTP_PORT=2375
WWW_HTTPS_PORT=2376
I’ve got those port numbers from this install page: https://marketplace.digitalocean.com/apps/docker
I have setup a firewall in my control panel: HTTP TCP 80 HTTPS TCP 443
but I’m still getting a 404 - nginx/1.10.3 (Ubuntu) page.
Any help would be appreciated. thanks.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Greetings!
It looks like you might be trying to expose the docker container to the docker daemon ports. You also may have an existing install of Nginx that you have running. If you intend to expose your app directly to web ports, you may also want to disable/remove the Nginx installation that is running.
Make sure that your ports are mapping to the ones that you want. So if the internal port were 81 and you want the external port to be 80, it’s “80:81” when spinning up the container. In your case it’s probably just “80:80” but I wanted to show that it’s “exposed:source” when mapping.
To give you some insight into my world and how I expose containers, I have a copy of searx running with this command:
docker run -d -p 82:8888 wonderfall/searx
Then I have Caddy running a reverse proxy (maybe you intend to use Nginx) with this config:
search.jar.land {
tls jarland@gmail.com
proxy / http://127.0.0.1:82 {
transparent
}
}
You can see it exposed at search.jar.land. Hopefully that helps :)
Jarland
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.