Reputation: 5871
I have a dockerfile that works by itself, with
docker build -t image_apache .
docker run -tid -p 5000:80 --name=container_apache image_apache
This works, and I can connect to its webserver with 127.0.0.1:5000
But when I try to create a docker-compose.yml file to build and run the image with docker-compose, it doesn't appear to expose the port at all.
Here is the docker-compose.yaml
version: '3'
services:
deploy_test:
ports:
- "8080:80"
build: .
working_dir: /tmp/artifacts
docker-compose build
docker-compose run deploy_test
My browser can't connect to 127.0.0.1:8080, and the apache log in the container doesn't show any attempts.
Do I just have a bad syntax for the port? It matches online samples.
Upvotes: 4
Views: 12235