-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
185 lines (175 loc) · 4.7 KB
/
docker-compose.yml
File metadata and controls
185 lines (175 loc) · 4.7 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
185
x-env: &env
POSTGRES_DB: accounts
POSTGRES_USER: accounts
POSTGRES_PASSWORD: accounts
TBA_DEV: yes
services:
postgres:
image: postgres:17
volumes:
- "db:/var/lib/postgresql/data"
ports:
- "5433:5432" # Note: host is exposed to 5433!
environment:
POSTGRES_USER: accounts
POSTGRES_DB: accounts
POSTGRES_PASSWORD: accounts
# set shared memory limit when using docker-compose
shm_size: 128mb
# Keycloak's postgres database
kcpostgres:
image: postgres:17
volumes:
- "kcdb:/var/lib/postgresql/data"
ports:
- "5434:5434" # Note: host is exposed to 5434!
environment:
POSTGRES_USER: kc
POSTGRES_DB: keycloak
POSTGRES_PASSWORD: kc
PGPORT: 5434
# set shared memory limit when using docker-compose
shm_size: 128mb
redis:
image: redis/redis-stack
volumes:
- "cache:/data"
ports:
- "6380:6379" # Redis exposed on port 6380
- "8071:8001" # Insights exposed on port 8071
accounts: &accounts
build:
context: .
dockerfile: ./Dockerfile
ports:
- "8087:8087"
environment:
<<: *env
ALLOWED_HOSTS: '*'
volumes:
- "./.env:/app/.env:z"
- "./.env.test:/app/.env.test:z"
- "./src/thunderbird_accounts:/app/src/thunderbird_accounts:z"
- "./assets:/app/assets:z"
- "./keycloak:/app/assets/keycloak:z"
- "./templates:/app/templates:z"
depends_on:
- postgres
- redis
develop:
watch:
- action: rebuild
path: .env
- action: rebuild
path: .env.test
- action: rebuild
path: ./src
- action: rebuild
path: ./assets
- action: rebuild
path: ./keycloak
- action: rebuild
path: ./templates
celery:
<<: *accounts
ports: []
# Workaround for embedded beat (--beat) spinning at 100% CPU in Docker.
# Docker inherits a huge SC_OPEN_MAX (~1B) causing close_open_fds() to loop.
# https://github.com/celery/celery/issues/8306
ulimits:
nofile:
soft: 10000
hard: 10000
environment:
<<: *env
TBA_CELERY: yes
flower:
<<: *accounts
ports:
- "5555:5555"
environment:
<<: *env
TBA_FLOWER: yes
# Only used when APP_DEBUG=True
vite-dev:
build:
context: .
dockerfile: ./Dockerfile
# Run both vite devserver for accounts frontend, and the keycloak theme builder
entrypoint: bash -c 'npm run dev & npm run dev-theme'
ports:
- "5173:5173"
volumes:
- "./.env:/app/.env:z"
- "./.env.test:/app/.env.test:z"
- "./vite.config.mts:/app/vite.config.mts:z"
- "./tsconfig.json:/app/tsconfig.json:z"
- "./src/thunderbird_accounts:/app/src/thunderbird_accounts:z"
- "./assets:/app/assets:z"
- "./templates:/app/templates:z"
- "./keycloak/themes:/app/keycloak/themes:z"
stalwart:
image: stalwartlabs/stalwart:v0.13
#build:
# context: ../stalwart
# dockerfile: Dockerfile
volumes:
- "./mail:/opt/stalwart:z"
ports:
- "443:443"
- "8080:8080"
- "8081:8081"
- "25:25"
- "587:587"
- "465:465"
- "143:143"
- "993:993"
- "4190:4190"
- "110:110"
- "995:995"
environment:
<<: *env
ADMIN_SECRET: "{plain}accounts"
MAIL_STALWART_PATH: "/opt/stalwart"
keycloak:
#image: quay.io/keycloak/keycloak:latest
build:
context: .
dockerfile: Dockerfile.keycloak
ports:
- "8999:8999"
- "9000:9000"
# If you need to export the realm uncomment this. You'll see the data in ./keycloak/data/export
#entrypoint: '/opt/keycloak/bin/kc.sh export --dir /opt/keycloak/data/export'
environment:
KC_HTTP_PORT: 8999
KC_HOSTNAME: keycloak
KC_HOSTNAME_STRICT_BACKCHANNEL: "true"
KC_HEALTH_ENABLED: "true"
KC_LOG_LEVEL: info
KC_DB: "postgres"
KC_DB_URL_HOST: "kcpostgres"
KC_DB_URL_PORT: '5434'
KC_DB_USERNAME: "kc"
KC_DB_PASSWORD: "kc"
KC_DEV: yes # Run the container with start-dev instead of start
KC_SPI_THEME_WELCOME_THEME: "tbpro"
KC_TBPRO_HOME: "http://localhost:8087/"
KC_TBPRO_SIGN_UP: "http://localhost:8087/sign-up"
KC_TBPRO_CONTACT: "http://localhost:8087/contact"
KC_TBPRO_PRIMARY_DOMAIN: "example.org"
volumes:
- "./keycloak/themes:/opt/keycloak/themes:z"
- "./keycloak/data/export:/opt/keycloak/data/export:z"
# Capturing keycloak emails for dev
mailpit:
image: axllent/mailpit
environment:
- MP_SMTP_AUTH_ALLOW_INSECURE=true
ports:
- "8025:8025" # Web UI
- "1025:1024" # SMTP
volumes:
db: {}
kcdb: {}
cache: {}