Created
September 25, 2024 07:22
-
-
Save artemgordinskiy/eaee95c6ce8afe494e654b9423b177b9 to your computer and use it in GitHub Desktop.
Example Coolify Django Docker Compose file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.8' | |
services: | |
my_app_web: | |
build: | |
context: . | |
dockerfile: Dockerfile.web | |
environment: | |
PORT: ${PORT} | |
DJANGO_SETTINGS_MODULE: my_app.settings_production | |
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} | |
SECRET_KEY: ${SECRET_KEY} | |
DATABASE_URL: ${DATABASE_URL} | |
REDIS_URL: ${REDIS_URL} | |
restart: unless-stopped | |
stop_grace_period: 60s | |
ports: | |
- "${PORT}:8000" | |
celery: | |
build: | |
context: . | |
dockerfile: Dockerfile.web | |
command: celery -A my_app worker -l INFO --concurrency 4 | |
environment: | |
DJANGO_SETTINGS_MODULE: my_app.settings_production | |
USE_S3_MEDIA: 'true' | |
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python | |
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} | |
SECRET_KEY: ${SECRET_KEY} | |
DATABASE_URL: ${DATABASE_URL} | |
REDIS_URL: ${REDIS_URL} | |
celery_beat: | |
build: | |
context: . | |
dockerfile: Dockerfile.web | |
command: celery -A my_app beat -l INFO | |
environment: | |
DJANGO_SETTINGS_MODULE: my_app.settings_production | |
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} | |
SECRET_KEY: ${SECRET_KEY} | |
DATABASE_URL: ${DATABASE_URL} | |
REDIS_URL: ${REDIS_URL} | |
restart: unless-stopped |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment