I have project running on docker container in staging mode, actually I have two compose files, for staging and production in the same directory. At the moment stagin.yml is running, when I want to run production.yml , staging.yml stoppes running.
staging.yml
version: '3'
volumes:
staging_postgres_data: {}
staging_postgres_data_backups: {}
staging_staticfiles: {}
staging_mediafiles: {}
services:
django:
build:
context: .
dockerfile: ./compose/staging/django/Dockerfile
image: project_staging_django
depends_on:
- postgres
- redis
env_file:
- ./.envs/.staging/.django
- ./.envs/.staging/.postgres
volumes:
- staging_mediafiles:/app/project/media
command: /start
postgres:
build:
context: .
dockerfile: ./compose/production/postgres/Dockerfile
image: project_staging_postgres
volumes:
- staging_postgres_data:/var/lib/postgresql/data
- staging_postgres_data_backups:/backups
env_file:
- ./.envs/.staging/.postgres
bot:
image: project_local_bot
container_name: project_local_bot
build:
context: .
dockerfile: ./compose/staging/pytelegrambot/Dockerfile
volumes:
- ./bot:/bots:z
env_file:
- ./.envs/.staging/.bot
command: /start
nginx:
restart: unless-stopped
build:
context: .
dockerfile: ./compose/staging/nginx/Dockerfile
container_name: project_staging_nginx
ports:
- 3080:80
- 3443:443
volumes:
- staging_mediafiles:/app/project/media
depends_on:
- django
redis:
image: redis:6
production.yml
version: '3'
volumes:
production_postgres_data: {}
production_postgres_data_backups: {}
production_mediafiles: {}
services:
django:
build:
context: .
dockerfile: ./compose/production/django/Dockerfile
image: project_production_django
container_name: project_production_django
depends_on:
- postgres
- redis
env_file:
- ./.envs/.production/.django
- ./.envs/.production/.postgres
volumes:
- production_mediafiles:/app/project/media
command: /start
postgres:
build:
context: .
dockerfile: ./compose/production/postgres/Dockerfile
image: project_production_postgres
container_name: project_production_postgres
ports:
- 5433:5432
volumes:
- production_postgres_data:/var/lib/postgresql/data
- production_postgres_data_backups:/backups
env_file:
- ./.envs/.production/.postgres
nginx:
restart: unless-stopped
build:
context: .
dockerfile: ./compose/production/nginx/Dockerfile
image: project_production_nginx
container_name: project_production_nginx
ports:
- 8080:80
- 8043:443
volumes:
- production_mediafiles:/app/project/media
depends_on:
- django
bot:
image: project_production_bot
container_name: project_production_bot
build:
context: .
dockerfile: ./compose/production/pytelegrambot/Dockerfile
volumes:
- ./bot:/bots:z
env_file:
- ./.envs/.production/.bot
command: /start
redis:
image: redis:6
container_name: project_production_redis
ports:
- 6378:6379
All ports are different and volumes are different I guess, I don't understand what is happening. Thanks in advance.