-Disable traefik celery

- Added different ACME directory with correct persmissions so that it can be added as volume
- ACME volume to reuse certificate by other containers
This commit is contained in:
Demetris Stavrou 2018-06-21 13:39:05 +00:00
parent 52ed5a5f29
commit 390f2c4a76
4 changed files with 12 additions and 11 deletions

View File

@ -1,3 +0,0 @@
# Caddy
# ------------------------------------------------------------------------------
DOMAIN_NAME={{ cookiecutter.domain_name }}

View File

@ -1,2 +1,5 @@
FROM traefik FROM traefik:alpine
RUN mkdir -p /etc/traefik/acme
RUN touch /etc/traefik/acme/acme.json
RUN chmod 600 /etc/traefik/acme/acme.json
COPY ./compose/production/traefik/traefik.toml /etc/traefik COPY ./compose/production/traefik/traefik.toml /etc/traefik

View File

@ -1,9 +1,10 @@
logLevel = "ERROR" logLevel = "DEBUG"
defaultEntryPoints = ["http", "https"] defaultEntryPoints = ["http", "https"]
[web] [web]
# Port for the status page # Port for the status page
address = ":7080" address = ":8080"
dashboard = true
# Entrypoints, http and https # Entrypoints, http and https
[entryPoints] [entryPoints]
@ -21,7 +22,7 @@ address = ":7080"
[acme] [acme]
# Email address used for registration # Email address used for registration
email = "{{ cookiecutter.email }}" email = "{{ cookiecutter.email }}"
storageFile = "acme.json" storageFile = "/etc/traefik/acme/acme.json"
entryPoint = "https" entryPoint = "https"
onDemand = false onDemand = false
OnHostRule = true OnHostRule = true

View File

@ -3,6 +3,7 @@ version: '2'
volumes: volumes:
postgres_data: {} postgres_data: {}
postgres_backup: {} postgres_backup: {}
traefik_acme: {}
services: services:
django:{% if cookiecutter.use_celery == 'y' %} &django{% endif %} django:{% if cookiecutter.use_celery == 'y' %} &django{% endif %}
@ -20,7 +21,7 @@ services:
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.backend=django" - "traefik.backend=django"
- "traefik.frontend.rule={{ cookiecutter.domain_name }}" - "traefik.frontend.rule=Host:{{ cookiecutter.domain_name }}"
- "traefik.port=5000" - "traefik.port=5000"
postgres: postgres:
@ -43,12 +44,11 @@ services:
- django - django
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro - /var/run/docker.sock:/var/run/docker.sock:ro
# - ./traefik/traefik.toml:/etc/traefik/traefik.toml:ro - traefik_acme:/etc/traefik/acme
# - ./traefik/acme:/etc/traefik/acme
ports: ports:
- "80:80" - "80:80"
- "443:443" - "443:443"
- "7080:7080" - "8080:8080"
redis: redis:
image: redis:3.2 image: redis:3.2