mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-09-08 21:24:58 +03:00
run traefik as non-root user
This commit is contained in:
parent
da0a683f2f
commit
837c869965
|
@ -1,5 +1,21 @@
|
||||||
FROM traefik:v2.2.11
|
FROM traefik:2.3
|
||||||
RUN mkdir -p /etc/traefik/acme \
|
|
||||||
&& touch /etc/traefik/acme/acme.json \
|
WORKDIR /etc/traefik/
|
||||||
&& chmod 600 /etc/traefik/acme/acme.json
|
|
||||||
COPY ./compose/production/traefik/traefik.yml /etc/traefik
|
RUN addgroup --system traefik \
|
||||||
|
&& adduser \
|
||||||
|
--disabled-password \
|
||||||
|
--gecos '' \
|
||||||
|
--no-create-home \
|
||||||
|
--ingroup traefik \
|
||||||
|
traefik \
|
||||||
|
&& mkdir acme/ \
|
||||||
|
&& touch acme/acme.json \
|
||||||
|
&& chmod 0600 acme/acme.json \
|
||||||
|
&& chown -R traefik:traefik .
|
||||||
|
|
||||||
|
EXPOSE 8080/tcp 8443/tcp
|
||||||
|
|
||||||
|
VOLUME /etc/traefik/acme/
|
||||||
|
|
||||||
|
USER traefik
|
||||||
|
|
|
@ -5,7 +5,7 @@ log:
|
||||||
entryPoints:
|
entryPoints:
|
||||||
web:
|
web:
|
||||||
# http
|
# http
|
||||||
address: ":80"
|
address: ":8080"
|
||||||
http:
|
http:
|
||||||
# https://docs.traefik.io/routing/entrypoints/#entrypoint
|
# https://docs.traefik.io/routing/entrypoints/#entrypoint
|
||||||
redirections:
|
redirections:
|
||||||
|
@ -14,7 +14,7 @@ entryPoints:
|
||||||
|
|
||||||
web-secure:
|
web-secure:
|
||||||
# https
|
# https
|
||||||
address: ":443"
|
address: ":8443"
|
||||||
{%- if cookiecutter.use_celery == 'y' %}
|
{%- if cookiecutter.use_celery == 'y' %}
|
||||||
|
|
||||||
flower:
|
flower:
|
||||||
|
|
|
@ -39,6 +39,7 @@ services:
|
||||||
- django
|
- django
|
||||||
volumes:
|
volumes:
|
||||||
- production_traefik:/etc/traefik/acme:z
|
- production_traefik:/etc/traefik/acme:z
|
||||||
|
- ./compose/production/traefik/traefik.yml:/etc/traefik/traefik.yml:ro
|
||||||
ports:
|
ports:
|
||||||
- "0.0.0.0:80:80"
|
- "0.0.0.0:80:80"
|
||||||
- "0.0.0.0:443:443"
|
- "0.0.0.0:443:443"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user