Answer the question
In order to leave comments, you need to log in
How do I add Composer (which is PHP) to a Docker Compose container (in a docker-compose.yml file)?
I cloned the Docker Compose container, but the problem is that to start the project I need to run
composer install
and I don’t have it installed locally (100500 PHP extensions need to be configured there).
Is there any way to add it to the container? How exactly?
Here is docker-compose.yml
version: '3.2'
networks:
movies:
driver: bridge
services:
api:
build:
context: .
dockerfile: Dockerfile
args:
- WITH_XDEBUG=true
networks:
- movies
volumes:
- .:/opt/project
depends_on:
- neo4j
restart: always
expose:
- 9000
environment:
- NEO4J_USER=neo4j
- NEO4J_PASSWORD=abcde
- NEO4J_DATABASE=neo4j
proxy:
build:
context: .
dockerfile: proxy/Dockerfile
networks:
- movies
ports:
- "80:80"
- "8080:8080"
depends_on:
- api
restart: always
neo4j:
networks:
- movies
image: neo4j:latest
volumes:
- neo4j:/data
- .:/opt/project
environment:
- NEO4J_AUTH=neo4j/abcde
restart: always
expose:
- 7474
- 7687
- 6362
ports:
- "7474:7474"
- "7687:7687"
volumes:
neo4j:
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question