public-health-ch/ansible/roles/web/templates/docker-compose.j2
2020-02-18 18:02:47 +01:00

44 lines
1.2 KiB
Django/Jinja

web:
build: .
dockerfile: .dockerfile
command: gunicorn {{ django_project_name }}.wsgi:application -b 0.0.0.0:5000 -w 5 --log-file=-
volumes:
- ./:/usr/src/app
- {{ django_log_dir }}:/var/log/wagtail
#links:
# - redis
# - postgres
# - elasticsearch
ports:
- "5000:5000"
environment:
- DJANGO_SETTINGS_MODULE={{ django_project_name }}.settings.production
- ALLOWED_HOSTS=www.{{ allowed_domains|join(',www.') }},{{ allowed_domains|join(',') }},{{ ipv4_addresses|join(':5000,') }}
- SECRET_KEY={{ django_secret_key }}
- MAILGUN_KEY={{ django_email_key }}
- MAILGUN_DOMAIN={{ django_email_domain }}
- MAILGUN_FROM={{ django_email_from }}
- DATABASE_URL={{ django_postgres_url }}
- REDIS_URL={{ django_redis_url }}
- LOG_DIR=/var/log/wagtail
# - ELASTICSEARCH_URL={{ django_elasticsearch_url }}
# elasticsearch:
# image: elasticsearch:5
# ports:
# - "9200:9200"
# environment:
# - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
# mem_limit: 1g
# redis:
# image: redis
# command: ["redis-server", "--appendonly", "yes"]
# restart: on-failure
# volumes:
# - {{ redis_data_dir }}:/data
# ports:
# - "6379:6379"
# postgres:
# image: postgres
# ports:
# - "5432:5432"