I'm trying to run a container using docker compose. I already did it using normal docker commands and it works, but when I do the same using docker compose it did not work as expected.
I compile the image using docker compose build command:
docker-compose build php
and use that image for both docker and docker-compose commands.
docker run -p 80:80 -v /navicu docker_php
docker-compose up php
I allays change the port of one of the container so they never collapse. For example: port 80 on docker and 800 on docker-compose.
The problem is that no matter what I do, the docker-compose container is not working as expected. It doesn't let connections on the localhost (it shows a 500 error). On the other hand the docker container allows the connection and show the page as expected.
Here is the docker-compose.yml:
php:
build: .
ports:
- "80:80"
volumes:
- ./navicu:/navicu
PD: the Dockerfile use a php-apache official image and add a vhost.conf file.