mirror of
https://github.com/Kugelschieber/marvinblum.git
synced 2026-01-18 14:50:27 +00:00
Updated docker-compose to use env file and added propper www redirect.
This commit is contained in:
@@ -8,8 +8,6 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- traefik-internal
|
- traefik-internal
|
||||||
command:
|
command:
|
||||||
# - "--log.level=DEBUG"
|
|
||||||
# - "--api.insecure=true"
|
|
||||||
- "--providers.docker=true"
|
- "--providers.docker=true"
|
||||||
- "--providers.docker.exposedbydefault=false"
|
- "--providers.docker.exposedbydefault=false"
|
||||||
- "--providers.docker.network=marvinblum_traefik-internal"
|
- "--providers.docker.network=marvinblum_traefik-internal"
|
||||||
@@ -17,21 +15,29 @@ services:
|
|||||||
- "--entrypoints.websecure.address=:443"
|
- "--entrypoints.websecure.address=:443"
|
||||||
- "--certificatesresolvers.tls-resolver.acme.httpchallenge=true"
|
- "--certificatesresolvers.tls-resolver.acme.httpchallenge=true"
|
||||||
- "--certificatesresolvers.tls-resolver.acme.httpchallenge.entrypoint=web"
|
- "--certificatesresolvers.tls-resolver.acme.httpchallenge.entrypoint=web"
|
||||||
# - "--certificatesresolvers.tls-resolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
|
|
||||||
- "--certificatesresolvers.tls-resolver.acme.email=marvin@marvinblum.de"
|
- "--certificatesresolvers.tls-resolver.acme.email=marvin@marvinblum.de"
|
||||||
- "--certificatesresolvers.tls-resolver.acme.storage=/letsencrypt/acme.json"
|
- "--certificatesresolvers.tls-resolver.acme.storage=/letsencrypt/acme.json"
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
- "443:443"
|
- "443:443"
|
||||||
# - "8080:8080"
|
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
- /root/marvinblum/letsencrypt:/letsencrypt
|
- /root/marvinblum/letsencrypt:/letsencrypt
|
||||||
# labels:
|
labels:
|
||||||
# - "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
# - "traefik.port=8080"
|
# Global redirection: http to https
|
||||||
# - "traefik.http.routers.traefik.entrypoints=web"
|
- 'traefik.http.routers.http-catchall.rule=HostRegexp(`{host:(www\.)?.+}`)'
|
||||||
# - "traefik.http.routers.traefik.service=api@internal"
|
- "traefik.http.routers.http-catchall.entrypoints=web"
|
||||||
|
- "traefik.http.routers.http-catchall.middlewares=wwwtohttps"
|
||||||
|
# Global redirection: https (www.) to https
|
||||||
|
- 'traefik.http.routers.wwwsecure-catchall.rule=HostRegexp(`{host:(www\.).+}`)'
|
||||||
|
- "traefik.http.routers.wwwsecure-catchall.entrypoints=websecure"
|
||||||
|
- "traefik.http.routers.wwwsecure-catchall.tls=true"
|
||||||
|
- "traefik.http.routers.wwwsecure-catchall.middlewares=wwwtohttps"
|
||||||
|
# middleware: http(s)://(www.) to https://
|
||||||
|
- 'traefik.http.middlewares.wwwtohttps.redirectregex.regex=^https?://(?:www\.)?(.+)'
|
||||||
|
- 'traefik.http.middlewares.wwwtohttps.redirectregex.replacement=https://$${1}'
|
||||||
|
- 'traefik.http.middlewares.wwwtohttps.redirectregex.permanent=true'
|
||||||
marvinblum:
|
marvinblum:
|
||||||
image: kugel/marvinblum
|
image: kugel/marvinblum
|
||||||
container_name: marvinblum
|
container_name: marvinblum
|
||||||
@@ -41,25 +47,19 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- postgres_db-internal
|
- postgres_db-internal
|
||||||
- traefik-internal
|
- traefik-internal
|
||||||
|
env_file:
|
||||||
|
- secrets.env
|
||||||
environment:
|
environment:
|
||||||
MB_EMVI_CLIENT_ID: 3fBBn144yvSF9R3dPC8l
|
MB_EMVI_CLIENT_ID: 3fBBn144yvSF9R3dPC8l
|
||||||
MB_EMVI_CLIENT_SECRET: dw3FeshelTgdf1Gj13J7uF5FfdPDi40sQvvwqeFVKTTyIDuCdlAHhRY72csFL6yg
|
|
||||||
MB_EMVI_ORGA: marvin
|
MB_EMVI_ORGA: marvin
|
||||||
MB_DB_HOST: postgres
|
MB_DB_HOST: postgres
|
||||||
MB_DB_USER:
|
|
||||||
MB_DB_PASSWORD:
|
|
||||||
MB_DB_SCHEMA:
|
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.port=8888"
|
- "traefik.port=8888"
|
||||||
- "traefik.http.routers.marvinblum.entrypoints=web"
|
- "traefik.http.routers.schnittfest.rule=Host(`marvinblum.de`) || Host(`www.marvinblum.de`)"
|
||||||
- "traefik.http.routers.marvinblum.rule=Host(`marvinblum.de`)"
|
- "traefik.http.routers.schnittfest.entrypoints=websecure"
|
||||||
- "traefik.http.routers.marvinblum.middlewares=http-redirect"
|
- "traefik.http.routers.schnittfest.tls=true"
|
||||||
- "traefik.http.routers.marvinblum-secure.entrypoints=websecure"
|
- "traefik.http.routers.schnittfest.tls.certresolver=tls-resolver"
|
||||||
- "traefik.http.routers.marvinblum-secure.rule=Host(`marvinblum.de`)"
|
|
||||||
- "traefik.http.routers.marvinblum-secure.tls.certresolver=tls-resolver"
|
|
||||||
- "traefik.http.middlewares.http-redirect.redirectscheme.scheme=https"
|
|
||||||
- "traefik.http.middlewares.http-redirect.redirectscheme.permanent=true"
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
traefik-internal:
|
traefik-internal:
|
||||||
|
|||||||
4
secrets.env
Normal file
4
secrets.env
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
MB_EMVI_CLIENT_SECRET=
|
||||||
|
MB_DB_USER=
|
||||||
|
MB_DB_PASSWORD=
|
||||||
|
MB_DB_SCHEMA=
|
||||||
Reference in New Issue
Block a user