-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
143 lines (143 loc) · 6.68 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
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
services:
roundcube:
image: ghcr.io/foodcoopsat/roundcube
environment:
ROUNDCUBEMAIL_DB_TYPE: sqlite
ROUNDCUBEMAIL_DB_USER: roundcube
ROUNDCUBEMAIL_DB_HOST: mariadb
ROUNDCUBEMAIL_DB_SQLITE_PATH: /sqlite.db
ROUNDCUBEMAIL_DB_NAME: roundcube
ROUNDCUBEMAIL_DEFAULT_HOST: ssl://mail.local.at
ROUNDCUBEMAIL_DEFAULT_PORT: 993
ROUNDCUBEMAIL_SMTP_SERVER: ssl://mail.local.at
ROUNDCUBEMAIL_SMTP_PORT: 465
ROUNDCUBEMAIL_PLUGINS: archive,markasjunk,managesieve,nonce_login,zipdownload
healthcheck:
test: curl -f http://localhost/
start_interval: 10s
labels:
traefik.enable: "true"
traefik.http.middlewares.mail-admin.redirectregex.regex: ^https?://mail.local.at/admin(.*)
traefik.http.middlewares.mail-admin.redirectregex.replacement: https://app.local.at/discourse-virtmail/addresses
traefik.http.middlewares.roundcube-oauth.redirectregex.regex: ^https?://mail.local.at/index.php/login/oauth\?(.*)$$
traefik.http.middlewares.roundcube-oauth.redirectregex.replacement: https://mail.local.at/?_task=login&_action=oauth&$${1}
traefik.http.services.roundcube.loadbalancer.server.port: 80
traefik.http.routers.roundcube.entrypoints: https
traefik.http.routers.roundcube.middlewares: mail-admin,roundcube-oauth
traefik.http.routers.roundcube.rule: Host(`mail.local.at`)
traefik.http.routers.roundcube.tls: "true"
traefik.http.routers.roundcube.tls.domains[0].main: mail.local.at
volumes:
- "./dev_config/roundcube.php/:/usr/src/roundcubemail/config/config.inc.php:ro"
- "./dev_config/roundcube_secret:/run/secrets/roundcube_db_password"
- "./dev_config/roundcube_secret:/run/secrets/roundcube_des_key"
- "./dev_config/roundcube_secret:/run/secrets/roundcube_oauth_client_secret"
mkcert:
image: vishnunair/docker-mkcert
environment:
- domain=app.local.at,traefik.local.at,*.local.at
volumes:
- ./dev_data/certs/:/root/.local/share/mkcert
labels:
- "traefik.enable=false"
traefik:
image: traefik
ports:
- 80:80
- 443:443
- 8080:8080
volumes:
- /run/docker.sock:/var/run/docker.sock
- "./dev_data/certs/:/etc/certs:ro"
- "./dev_config/traefik.yaml:/etc/traefik/traefik.yaml:ro"
- "./dev_config/traefik.d:/etc/traefik/conf.d:ro"
labels:
traefik.enable: "true"
traefik.http.routers.traefik_api.entrypoints: https
traefik.http.routers.traefik_api.rule: Host(`traefik.local.at`)
traefik.http.routers.traefik_api.service: api@internal
traefik.http.routers.traefik_api.tls: "true"
redis:
image: redis:6.2-alpine
restart: always
command: redis-server --save 20 1 --loglevel warning
volumes:
- ./dev_data/redis_data:/data
postgres:
image: postgres:15-alpine
restart: always
environment:
- POSTGRES_USER=discourse
- POSTGRES_PASSWORD=iZ2nF2KBjzL3nLLDYkpCGQ
volumes:
- ./dev_data/postgres_data:/var/lib/postgresql/data
discourse_sidekiq: &discourse
build:
context: .
environment:
- RAILS_ENV=production
- DISCOURSE_HOSTNAME=forum.test.net
- DISCOURSE_DB_HOST=postgres
- DISCOURSE_REDIS_HOST=redis
- DISCOURSE_SMTP_ADDRESS=mailcatcher
- DISCOURSE_SMTP_DOMAIN=mailcatcher.local.at
- DISCOURSE_DB_PASSWORD=iZ2nF2KBjzL3nLLDYkpCGQ
# sysctls:
# - net.ipv6.conf.all.disable_ipv6=1
volumes:
- ./dev_data/discourse_backups:/home/discourse/discourse/public/backups
- ./dev_data/discourse_uploads:/home/discourse/discourse/public/uploads
- ./dev_config/discourse-multisite.yml:/home/discourse/discourse/config/multisite.yml
- ./dev_config/discourse.d/production.rb:/home/discourse/discourse/config/environments/production.rb
- ./dev_config/discourse.d/development.rb:/home/discourse/discourse/config/environments/development.rb
- ./plugins/discourse-virtmail:/home/discourse/discourse/plugins/discourse-virtmail/
depends_on:
- redis
- postgres
command: bundle exec sidekiq -q critical -q default -q low -v
discourse:
<<: *discourse
labels:
traefik.enable: "true"
traefik.http.routers.discourse.entrypoints: https
traefik.http.routers.discourse.rule: Host(`app.local.at`)
traefik.http.routers.discourse.tls: "true"
# traefik.http.routers.discourse.tls.certresolver: myresolver
traefik.http.services.discourse.loadbalancer.server.port: 3000
# traefik.http.services.discourse.loadbalancer.server.port: 4200
command: bundle exec rails server --binding '0.0.0.0'
# manually run docker compose exec -it discourse bin/rails server --port 3000
# also disable traefik on the nginx service
# command: node /usr/bin/pnpm --dir=app/assets/javascripts/discourse ember server --proxy http://localhost:3000 --host 0.0.0.0 --port 4200
healthcheck:
test: 'curl -f -H ''Host: forum.test.net'' http://localhost:3000/'
start_period: 10s
start_interval: 1s
interval: 10s
discourse_nginx:
<<: *discourse
command: nginx
labels:
traefik.enable: "true"
traefik.http.routers.discourse_nginx.entrypoints: https
traefik.http.routers.discourse_nginx.rule: HostRegexp(`app.local.at`) && (PathPrefix(`/assets/`, `/images/`, `/plugins/`, `/javascripts/`, `/uploads/{slug:\w+}/optimized/`))
traefik.http.routers.discourse_nginx.tls: "true"
traefik.http.services.discourse_nginx.loadbalancer.server.port: 8000
healthcheck:
test: 'curl -f -H ''Host: app.local.at'' http://localhost:8000/'
whoami:
image: traefik/whoami
container_name: simple-service
labels:
- traefik.enable=true
- traefik.http.routers.whoami.rule=Host(`whoami.localhost`)
- traefik.http.routers.whoami.entrypoints=https
- traefik.http.routers.whoami.tls=true
mailcatcher:
image: tophfr/mailcatcher
labels:
traefik.enable: "true"
traefik.http.routers.mailcatcher.entrypoints: https
traefik.http.routers.mailcatcher.rule: Host(`mailcatcher.local.at`)
traefik.http.routers.mailcatcher.tls: "true"
traefik.http.services.mailcatcher.loadbalancer.server.port: 80