-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
184 lines (165 loc) Β· 7.42 KB
/
docker-compose.yaml
File metadata and controls
184 lines (165 loc) Β· 7.42 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
services:
traefik:
image: traefik
container_name: traefik
ports:
- "80:80"
- "443:443"
environment:
# If you do not use Cloudflare, you can use other DNS providers
# ref: https://doc.traefik.io/traefik/https/acme/
CLOUDFLARE_EMAIL: <cloudflare_email>
CLOUDFLARE_DNS_API_TOKEN: <cloudflare_api_token>
extra_hosts:
- host.docker.internal:host-gateway
volumes:
# Uncomment this line if you want to use a dynamic configuration file
# - ./dynamic.yaml:/etc/traefik/dynamic/dynamic.yml:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./letsencrypt:/letsencrypt
command:
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --providers.docker=true
- --providers.docker.exposedbydefault=false
# dynamic configuration you can use for advanced routing
# - --providers.file.directory=/etc/traefik/dynamic
# - --providers.file.watch=true
# As you can see above, if you use other DNS providers, you must change the command below
- --certificatesresolvers.cfresolver.acme.dnschallenge.provider=cloudflare
- --certificatesresolvers.cfresolver.acme.email=<cloudflare_email>
- --certificatesresolvers.cfresolver.acme.storage=/letsencrypt/acme.json
- --certificatesresolvers.cfresolver.acme.dnschallenge.delaybeforecheck=0
sunflower:
image: ghcr.io/saebasol/sunflower:latest
container_name: sunflower
expose:
- "22222"
depends_on:
- postgres
- mongodb
environment:
# https://github.com/Saebasol/Sunflower/blob/main/sunflower/infrastructure/sanic/config.py
SUNFLOWER_USE_ENV: "true"
SUNFLOWER_PRODUCTION: "true"
SUNFLOWER_HOST: "0.0.0.0"
SUNFLOWER_SENTRY_DSN: ""
SUNFLOWER_GALLERYINFO_DB_URL: postgresql+asyncpg://postgres_example_user:postgres_example_passwd@postgres-heliotrope:5432/heliotrope
SUNFLOWER_INFO_DB_URL: mongodb://mongo_example_user:mongo_example_passwd@mongo-heliotrope:27017
SUNFLOWER_INDEX_FILES: '["index-korean.nozomi"]'
labels:
- "traefik.enable=true"
# HTTPS router
- "traefik.http.routers.heliotrope.rule=Host(`example.com`) && (Path(`/`) || Path(`/api/status`))"
- "traefik.http.routers.heliotrope.entrypoints=websecure"
- "traefik.http.routers.heliotrope.tls.certresolver=cfresolver"
- "traefik.http.services.heliotrope.loadbalancer.server.port=8000"
# HTTP β HTTPS
- "traefik.http.routers.heliotrope-http.rule=Host(`example.com`) && (Path(`/`) || Path(`/api/status`))"
- "traefik.http.routers.heliotrope-http.entrypoints=web"
- "traefik.http.routers.heliotrope-http.middlewares=https-redirect"
# www β non-www
- "traefik.http.routers.heliotrope-www.rule=Host(`www.example.com`) && (Path(`/`) || Path(`/api/status`))"
- "traefik.http.routers.heliotrope-www.entrypoints=web,websecure"
- "traefik.http.routers.heliotrope-www.middlewares=redirect-to-root"
- "traefik.http.routers.heliotrope-www.tls.certresolver=cfresolver"
# Middlewares
- "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
- "traefik.http.middlewares.redirect-to-root.redirectregex.regex=^https?://www\\.(.+)"
- "traefik.http.middlewares.redirect-to-root.redirectregex.replacement=https://$1"
- "traefik.http.middlewares.redirect-to-root.redirectregex.permanent=true"
heliotrope:
image: ghcr.io/saebasol/heliotrope:latest
container_name: heliotrope
expose:
- "8000"
depends_on:
- postgres
- mongodb
environment:
# https://github.com/Saebasol/Heliotrope/blob/main/heliotrope/infrastructure/sanic/config.py
HELIOTROPE_USE_ENV: "true"
HELIOTROPE_PRODUCTION: "true"
HELIOTROPE_HOST: "0.0.0.0"
HELIOTROPE_SENTRY_DSN: ""
HELIOTROPE_GALLERYINFO_DB_URL: postgresql+asyncpg://postgres_example_user:postgres_example_passwd@postgres-heliotrope:5432/heliotrope
HELIOTROPE_INFO_DB_URL: mongodb://mongo_example_user:mongo_example_passwd@mongo-heliotrope:27017
labels:
- "traefik.enable=true"
# HTTPS router
- "traefik.http.routers.heliotrope.rule=Host(`example.com`) && PathPrefix(`/`)"
- "traefik.http.routers.heliotrope.entrypoints=websecure"
- "traefik.http.routers.heliotrope.tls.certresolver=cfresolver"
- "traefik.http.services.heliotrope.loadbalancer.server.port=8000"
# HTTP β HTTPS
- "traefik.http.routers.heliotrope-http.rule=Host(`example.com`) && PathPrefix(`/`)"
- "traefik.http.routers.heliotrope-http.entrypoints=web"
- "traefik.http.routers.heliotrope-http.middlewares=https-redirect"
# www β non-www
- "traefik.http.routers.heliotrope-www.rule=Host(`www.example.com`) && PathPrefix(`/`)"
- "traefik.http.routers.heliotrope-www.entrypoints=web,websecure"
- "traefik.http.routers.heliotrope-www.middlewares=redirect-to-root"
- "traefik.http.routers.heliotrope-www.tls.certresolver=cfresolver"
# Middlewares
- "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
- "traefik.http.middlewares.redirect-to-root.redirectregex.regex=^https?://www\\.(.+)"
- "traefik.http.middlewares.redirect-to-root.redirectregex.replacement=https://$1"
- "traefik.http.middlewares.redirect-to-root.redirectregex.permanent=true"
hibiscus:
build:
context: https://github.com/Saebasol/Hibiscus.git
container_name: hibiscus
restart: always
environment:
- HELIOTROPE_BASE_URL=http://heliotrope:8000
ports:
- 3000:3000
depends_on:
- heliotrope
labels:
- "traefik.enable=true"
# HTTPS router
- "traefik.http.routers.hibiscus.rule=Host(`hibiscus.example.com`)"
- "traefik.http.routers.hibiscus.entrypoints=websecure"
- "traefik.http.routers.hibiscus.tls.certresolver=cfresolver"
- "traefik.http.services.hibiscus.loadbalancer.server.port=3000"
# HTTP β HTTPS
- "traefik.http.routers.hibiscus-http.rule=Host(`hibiscus.example.com`)"
- "traefik.http.routers.hibiscus-http.entrypoints=web"
- "traefik.http.routers.hibiscus-http.middlewares=https-redirect"
# www β non-www
- "traefik.http.routers.hibiscus-www.rule=Host(`www.hibiscus.example.com`)"
- "traefik.http.routers.hibiscus-www.entrypoints=web,websecure"
- "traefik.http.routers.hibiscus-www.middlewares=redirect-to-root"
- "traefik.http.routers.hibiscus-www.tls.certresolver=cfresolver"
# Middlewares
- "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
- "traefik.http.middlewares.redirect-to-root.redirectregex.regex=^https?://www\\.(.+)"
- "traefik.http.middlewares.redirect-to-root.redirectregex.replacement=https://$1"
- "traefik.http.middlewares.redirect-to-root.redirectregex.permanent=true"
postgres:
image: postgres
container_name: postgres-heliotrope
restart: always
ports:
- 5432:5432
volumes:
- pgdata:/var/lib/postgresql
environment:
POSTGRES_USER: postgres_example_user
POSTGRES_PASSWORD: postgres_example_passwd
POSTGRES_DB: heliotrope
mongodb:
container_name: mongo-heliotrope
image: mongo
restart: always
ports:
- 27017:27017
volumes:
- mongodb_data:/data/db
environment:
MONGO_INITDB_ROOT_USERNAME: mongo_example_user
MONGO_INITDB_ROOT_PASSWORD: mongo_example_passwd
volumes:
mongodb_data:
pgdata: