This repository was archived by the owner on May 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose-v2.yml
More file actions
152 lines (150 loc) · 4.16 KB
/
docker-compose-v2.yml
File metadata and controls
152 lines (150 loc) · 4.16 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
version: '3.7'
services:
# traefik
traefik:
image: 'traefik:v2.2'
container_name: 'traefik'
restart: always
environment:
- TZ=America/Los_Angeles
command:
- '--accesslog.fields.names.StartUTC=drop'
- '--providers.docker=true'
ports:
- 80:80
- 443:443
volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
- './data/traefik/traefik.yml:/etc/traefik/traefik.yml:ro'
- './data/traefik/acme.json:/acme.json'
- './data/traefik/logs:/var/log/traefik'
networks:
- traefik_proxy
labels:
# Dashboard
- 'traefik.enable=true'
- 'traefik.http.routers.traefik.rule=Host(`traefik.${DOMAIN_NAME}`)'
- 'traefik.http.routers.traefik.service=api@internal'
- 'traefik.http.routers.traefik.tls.certresolver=le'
- 'traefik.http.routers.traefik.entrypoints=secure'
# global redirect to https
- 'traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)'
- 'traefik.http.routers.http-catchall.entrypoints=insecure'
- 'traefik.http.routers.http-catchall.middlewares=redirect-to-https'
# middleware redirect
- 'traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https'
- 'traefik.http.routers.traefik.middlewares=traefik-forward-auth'
logging:
options:
max-size: '10m'
max-file: '3'
# Google Oauth
traefik-forward-auth:
image: thomseddon/traefik-forward-auth:2
container_name: oauth
restart: always
environment:
- PROVIDERS_GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID}
- PROVIDERS_GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET}
- SECRET=${OAUTH_SECRET}
- INSECURE_COOKIE=false # Example assumes no https, do not use in production
- COOKIE_DOMAIN=${DOMAIN_NAME}
- WHITELIST=${EMAIL_WHITELIST}
- LOG_LEVEL=debug
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.traefik-forward-auth.rule=Host(`oauth.${DOMAIN_NAME}`)'
- 'traefik.http.routers.traefik-forward-auth.entrypoints=secure'
- 'traefik.http.middlewares.traefik-forward-auth.forwardauth.address=http://traefik-forward-auth:4181'
- 'traefik.http.middlewares.traefik-forward-auth.forwardauth.authResponseHeaders=X-Forwarded-User'
- 'traefik.http.services.traefik-forward-auth.loadbalancer.server.port=4181'
networks:
- traefik_proxy
logging:
options:
max-size: '10m'
max-file: '3'
# redis
redis:
image: 'redis'
container_name: 'redis'
hostname: redis
restart: always
command:
[
'redis-server',
'/usr/local/etc/redis/redis.conf',
'--appendonly',
'yes',
'--bind',
'redis',
'--port',
'6379',
]
ports:
- 6379:6379
volumes:
- './data/redis/redis.conf:/usr/local/etc/redis/redis.conf'
- './data/redis:/data'
networks:
- default
labels:
- 'traefik.enable=false'
logging:
options:
max-size: '10m'
max-file: '3'
# postgres
postgres:
image: 'postgres'
env_file:
- database.env
container_name: 'postgres'
hostname: postgres
restart: always
ports:
- 5432:5432
volumes:
- './data/postgres:/var/lib/postgresql/data'
networks:
- default
labels:
- 'traefik.enable=false'
logging:
options:
max-size: '10m'
max-file: '3'
# app
suavescribe-v2:
image: '069410259217.dkr.ecr.us-west-1.amazonaws.com/suavescribe:latest'
container_name: 'suavescribe-v2'
restart: always
ports:
- 8081:8081
volumes:
- './app:/usr/app'
depends_on:
- redis
- postgres
links:
- redis
- postgres
networks:
- traefik_proxy
- default
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.app.rule=Host(`${DOMAIN_NAME}`)'
- 'traefik.http.routers.app.entrypoints=secure'
- 'traefik.http.routers.app.tls=true'
- 'traefik.http.routers.app.tls.certresolver=le'
logging:
options:
max-size: '10m'
max-file: '3'
networks:
traefik_proxy:
external:
name: traefik_proxy
default:
driver: bridge