This repository was archived by the owner on Nov 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
73 lines (62 loc) · 2.45 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
version: "3.7"
services:
traefik:
image: traefik:2.5.4
command:
# Try to enable this if something isn't working.
# Chances are, Traefik will tell you why.
# Be careful in production as it exposes the traffic you might not want to expose.
#--log.level=DEBUG
- --entrypoints.http.address=:80
- --entrypoints.https.address=:443
- --providers.docker=true
- --api=true
# LetsEncrypt Staging Server - uncomment when testing
# - --certificatesResolvers.letsencrypt.acme.caServer=https://acme-staging-v02.api.letsencrypt.org/directory
- --certificatesresolvers.letsencrypt.acme.httpchallenge=true
- --certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=http
- --certificatesresolvers.letsencrypt.acme.email=${EMAIL}
- --certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json
labels:
# Redirect all HTTP traffic to HTTPS
- traefik.http.routers.to-https.rule=HostRegexp(`{host:.+}`)
- traefik.http.routers.to-https.entrypoints=http
- traefik.http.routers.to-https.middlewares=to-https
- traefik.http.routers.traefik.rule=Host(`traefik.${DOMAIN}`)
- traefik.http.routers.traefik.entrypoints=https
- traefik.http.routers.traefik.middlewares=auth
- traefik.http.routers.traefik.service=api@internal
- traefik.http.routers.traefik.tls=true
- traefik.http.routers.traefik.tls.certresolver=${CERT_RESOLVER}
- traefik.http.middlewares.to-https.redirectscheme.scheme=https
- traefik.http.middlewares.auth.basicauth.users=${TRAEFIK_USER}:${TRAEFIK_PASSWORD_HASH}
ports:
- 80:80
- 443:443
volumes:
- ./data/letsencrypt:/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock:ro
db:
image: postgres:14.1-bullseye
volumes:
- ./data/db:/var/lib/postgresql/data
environment:
- POSTGRES_DB=${ENV_POSTGRES_DB}
- POSTGRES_USER=${ENV_POSTGRES_USER}
- POSTGRES_PASSWORD=${ENV_POSTGRES_PASSWORD}
rpg:
build:
context: /home/rjhadmin/tstsrv/rpg
dockerfile: Dockerfile
command: python rpg/manage.py runserver 0.0.0.0:8200
volumes:
- .:/code
depends_on:
- db
ports:
- 8200:8200
labels:
- traefik.http.routers.rpg.rule=Host(`rpg.${DOMAIN}`)
- traefik.http.routers.rpg.entrypoints=https
- traefik.http.routers.rpg.tls=true
- traefik.http.routers.rpg.tls.certresolver=${CERT_RESOLVER}