first commit
This commit is contained in:
111
docker-compose.c.yml
Normal file
111
docker-compose.c.yml
Normal file
@@ -0,0 +1,111 @@
|
||||
services:
|
||||
web:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./build/Dockerfile
|
||||
container_name: django_web_prod
|
||||
command: gunicorn core.wsgi:application --bind 0.0.0.0:8000 --workers 3
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
volumes:
|
||||
- static_volume:/app/staticfiles
|
||||
- media_volume:/app/media
|
||||
expose:
|
||||
- 8000
|
||||
networks:
|
||||
coolify:
|
||||
aliases:
|
||||
- django_web_prod
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -f http://localhost:8000/ || exit 1"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
environment:
|
||||
- DEBUG=0
|
||||
- SECRET_KEY=${SECRET_KEY}
|
||||
- USE_POSTGRES=${USE_POSTGRES}
|
||||
- POSTGRES_DB=${POSTGRES_DB}
|
||||
- POSTGRES_USER=${POSTGRES_USER}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
- POSTGRES_HOST=${POSTGRES_HOST:-10.80.80.50}
|
||||
- POSTGRES_PORT=${POSTGRES_PORT:-5432}
|
||||
- DJANGO_ALLOWED_HOSTS=${DJANGO_ALLOWED_HOSTS}
|
||||
- CELERY_BROKER_URL=${CELERY_BROKER_URL}
|
||||
- CELERY_RESULT_BACKEND=${CELERY_RESULT_BACKEND}
|
||||
restart: unless-stopped
|
||||
|
||||
celery:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./build/Dockerfile
|
||||
container_name: django_celery_prod
|
||||
command: celery -A core worker -l info
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
volumes:
|
||||
- media_volume:/app/media
|
||||
networks:
|
||||
- coolify
|
||||
environment:
|
||||
- DEBUG=0
|
||||
- SECRET_KEY=${SECRET_KEY}
|
||||
- USE_POSTGRES=${USE_POSTGRES}
|
||||
- POSTGRES_DB=${POSTGRES_DB}
|
||||
- POSTGRES_USER=${POSTGRES_USER}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
- POSTGRES_HOST=${POSTGRES_HOST:-10.80.80.50}
|
||||
- POSTGRES_PORT=${POSTGRES_PORT:-5432}
|
||||
- DJANGO_ALLOWED_HOSTS=${DJANGO_ALLOWED_HOSTS}
|
||||
- CELERY_BROKER_URL=${CELERY_BROKER_URL}
|
||||
- CELERY_RESULT_BACKEND=${CELERY_RESULT_BACKEND}
|
||||
depends_on:
|
||||
- web
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "celery -A core inspect ping"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
restart: unless-stopped
|
||||
|
||||
caddy:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./caddy/Dockerfile
|
||||
container_name: django_caddy
|
||||
expose:
|
||||
- 80
|
||||
networks:
|
||||
coolify:
|
||||
aliases:
|
||||
- nginx
|
||||
- nginx_proxy
|
||||
volumes:
|
||||
- static_volume:/app/staticfiles:ro
|
||||
- media_volume:/app/media:ro
|
||||
- caddy_data:/data
|
||||
- caddy_config:/config
|
||||
depends_on:
|
||||
- web
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:80/ || exit 1"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
restart: unless-stopped
|
||||
labels:
|
||||
- "coolify.managed=true"
|
||||
- "coolify.http.port=80"
|
||||
|
||||
volumes:
|
||||
static_volume:
|
||||
media_volume:
|
||||
caddy_data:
|
||||
caddy_config:
|
||||
|
||||
networks:
|
||||
coolify:
|
||||
external: true
|
||||
Reference in New Issue
Block a user