2024-08-12 19:22:51 +00:00
|
|
|
services:
|
|
|
|
db:
|
|
|
|
image: postgres:latest
|
|
|
|
command: postgres -c 'max_connections=200'
|
|
|
|
environment:
|
|
|
|
- POSTGRES_USER=${DB_USER}
|
|
|
|
- POSTGRES_PASSWORD=${DB_PASSWORD}
|
|
|
|
- POSTGRES_DB=${DB_NAME}
|
|
|
|
volumes:
|
|
|
|
- postgresql-data:/var/lib/postgresql/data
|
|
|
|
restart: on-failure
|
|
|
|
|
|
|
|
nginx:
|
|
|
|
command: nginx -g "daemon off;"
|
|
|
|
depends_on:
|
|
|
|
- app
|
2025-02-11 17:43:52 +00:00
|
|
|
- redis_commander
|
|
|
|
- rq_dashboard
|
2024-08-12 19:22:51 +00:00
|
|
|
image: nginx:alpine
|
|
|
|
restart: on-failure
|
|
|
|
volumes:
|
|
|
|
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
|
|
|
|
- static:/var/www/app/static
|
|
|
|
ports:
|
|
|
|
- "8000:8000"
|
|
|
|
|
|
|
|
app:
|
|
|
|
build:
|
|
|
|
context: .
|
2025-02-11 17:43:52 +00:00
|
|
|
dockerfile: docker/Dockerfile
|
2024-08-12 19:22:51 +00:00
|
|
|
command: bash -c 'while !</dev/tcp/db/5432; do sleep 1; done; python3 manage.py collectstatic --no-input; python3 manage.py migrate; uvicorn core.asgi:application --port 8000 --host 0.0.0.0'
|
|
|
|
volumes:
|
|
|
|
- ./src/:/app/
|
|
|
|
- static:/app/static
|
|
|
|
depends_on:
|
|
|
|
- db
|
|
|
|
- redis
|
|
|
|
restart: on-failure
|
|
|
|
env_file:
|
|
|
|
- .env
|
|
|
|
|
2025-02-11 17:43:52 +00:00
|
|
|
redis:
|
|
|
|
image: redis:latest
|
|
|
|
command: redis-server --requirepass ${REDIS_PASSWORD}
|
|
|
|
volumes:
|
|
|
|
- redis-data:/data
|
|
|
|
restart: on-failure
|
|
|
|
|
|
|
|
redis_commander:
|
|
|
|
image: rediscommander/redis-commander:latest
|
|
|
|
restart: always
|
|
|
|
depends_on:
|
|
|
|
- redis
|
|
|
|
environment:
|
|
|
|
URL_PREFIX: /redis_admin
|
|
|
|
REDIS_HOST: ${REDIS_HOST}
|
|
|
|
REDIS_PASSWORD: ${REDIS_PASSWORD}
|
|
|
|
REDIS_PORT: ${REDIS_PORT}
|
|
|
|
HTTP_USER: ${AUTH_HTTP_USER}
|
|
|
|
HTTP_PASSWORD: ${AUTH_HTTP_PASSWORD}
|
|
|
|
|
|
|
|
rq_dashboard:
|
|
|
|
image: kudaw/rq-dashboard
|
|
|
|
depends_on:
|
|
|
|
- redis
|
|
|
|
environment:
|
|
|
|
RQ_DASHBOARD_REDIS_URL: redis://:${BROKER_PASSWORD}@${BROKER_HOST}:${BROKER_PORT}/${BROKER_DB}
|
|
|
|
RQ_DASHBOARD_USERNAME: ${AUTH_HTTP_USER}
|
|
|
|
RQ_DASHBOARD_PASSWORD: ${AUTH_HTTP_PASSWORD}
|
|
|
|
RQ_DASHBOARD_URL_PREFIX: /dashboard
|
|
|
|
|
|
|
|
worker:
|
2024-08-12 19:22:51 +00:00
|
|
|
build:
|
|
|
|
context: .
|
2025-02-11 17:43:52 +00:00
|
|
|
dockerfile: docker/DockerfileWorker
|
|
|
|
command: bash -c 'supervisord -c /etc/supervisor/conf.d/supervisord.ini'
|
2024-08-12 19:22:51 +00:00
|
|
|
volumes:
|
|
|
|
- ./src/:/app/
|
2025-02-11 17:43:52 +00:00
|
|
|
- ./src/supervisord.ini:/etc/supervisor/conf.d/supervisord.ini
|
2024-08-12 19:22:51 +00:00
|
|
|
depends_on:
|
|
|
|
- redis
|
|
|
|
restart: on-failure
|
|
|
|
env_file:
|
|
|
|
- .env
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
postgresql-data:
|
|
|
|
static:
|
|
|
|
redis-data:
|
|
|
|
external: false
|