Hello.
I have a docker-compose script. After launching it, the files do not appear in the required directories, but project run successful. But if I create files in /app/backend before start containers, I can see a vendor dir with installed packages.
How to fix it?
version: '3.7'
networks:
frontend:
driver: bridge
ipam:
config:
- subnet: 10.5.0.0/16
backend:
driver: bridge
ipam:
config:
- subnet: 10.6.0.0/16
services:
php:
build:
context: .
dockerfile: .docker/php-dockerfile
container_name: myapp-php
ports:
- 9000:9000
volumes:
- ./app/backend:/var/www/backend
- ./app/logs:/var/www/logs
networks:
backend:
ipv4_address: 10.6.0.3
nginx:
build:
context: .
dockerfile: .docker/nginx-dockerfile
container_name: myapp-nginx
restart: unless-stopped
ports:
- 80:80
volumes:
- ./app/backend:/var/www/backend
- .docker/config/nginx:/etc/nginx/conf.d/
- ./app/logs/nginx:/var/log/nginx
depends_on:
- php
networks:
backend:
ipv4_address: 10.6.0.5
composer:
build:
context: .
dockerfile: .docker/composer-dockerfile
container_name: myapp-composer
command: composer install
depends_on:
- php
volumes:
- ./app/backend:/var/www/backend
networks:
backend:
ipv4_address: 10.6.0.6
app:
build:
context: .
dockerfile: .docker/node-dockerfile
container_name: myapp-node
command: npm run dev
environment:
NODE_ENV: production
working_dir: /var/www/html
ports:
- 443:443
volumes:
- ./app/frontend:/var/www/html
depends_on:
- php
networks:
backend:
ipv4_address: 10.6.0.2
frontend:
ipv4_address: 10.5.0.2