Refactored Docker Compose: updated service names, adjusted build contexts and targets, added missing environment variables, and updated volumes for consistency across development and production.

This commit is contained in:
kor-elf committed 2026-10-23 20:32:18 +05:00
1 parent cf55fa3ac9
commit a2b37d99c4
2 files changed
+54 -30

No files matched your search

+28 -19
View File
@@ -1,60 +1,68 @@
version: '3.7'
#version: '3.7'
services:
nginx:
web:
build:
context: ./nginx
dockerfile: Dockerfile
# restart: always
context: app
dockerfile: docker/Dockerfile
target: WEB_PRODUCTION
# restart: always
depends_on:
- app
- swagger
ports:
- ${DOCKER_NGINX_PORT}:80
- ${DOCKER_WEB_PORT}:80
environment:
IS_GZIP: 1
# FRONTEND_PORT: ${DOCKER_WEB_PORT}
BACKEND_HOST: app
BACKEND_PORT: 9000
TRUSTED_PROXY_CIDR: 172.16.0.0/12
# Enable swagger
ENABLE_API_DOCS: 1
volumes:
- ./app/application/public:/usr/share/nginx/html
- ./app/application/storage/app/public:/usr/share/nginx/html/storage
app:
build:
context: app
dockerfile: docker/Dockerfile
target: PRODUCTION
target: APP_PRODUCTION
# restart: always
# cap_drop:
# - ALL
# cap_add:
# - SETGID
# - SETUID
# - CHOWN
# - FOWNER
depends_on:
- db
- redis
- reverb
env_file: app/application/.env
volumes:
- ./app/application:/var/www/html
environment:
CONTAINER_ROLE: app
UNIT_SOURCE: '"172.16.0.0/12"'
APP_ENV: production
queue:
build:
context: app
dockerfile: docker/Dockerfile
target: PRODUCTION
target: APP_PRODUCTION
# restart: always
depends_on:
- db
- redis
environment:
CONTAINER_ROLE: queue
APP_ENV: production
volumes:
- ./app/application:/var/www/html
reverb:
build:
context: app
dockerfile: docker/Dockerfile
target: PRODUCTION
target: APP_PRODUCTION
# restart: always
depends_on:
- db
- redis
environment:
CONTAINER_ROLE: websockets
APP_ENV: production
ports:
- ${DOCKER_WEBSOCKET_PORT}:9000
volumes:
@@ -63,13 +71,14 @@ services:
build:
context: app
dockerfile: docker/Dockerfile
target: PRODUCTION
target: APP_PRODUCTION
# restart: always
depends_on:
- db
- redis
environment:
CONTAINER_ROLE: scheduler
APP_ENV: production
volumes:
- ./app/application:/var/www/html
swagger: