-
Notifications
You must be signed in to change notification settings - Fork 8
/
docker-compose.yml
149 lines (141 loc) · 5.99 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
144
145
146
147
148
149
# This file is a minimal plug and play working example of a runnable OpenShock stack.
services:
db: # We need a postgres database, preferably version 15+
image: postgres:16
restart: unless-stopped
container_name: openshock-postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
start_period: 20s
interval: 30s
retries: 5
timeout: 5s
networks:
- openshock
environment:
POSTGRES_PASSWORD: ${PG_PASS:?database password required}
POSTGRES_USER: ${PG_USER:-openshock}
POSTGRES_DB: ${PG_DB:-openshock}
volumes:
- ./postgres-data:/var/lib/postgresql/data # Data is saved in a folder called postgres-data in the current working directory
redis:
restart: unless-stopped
networks:
- openshock
image: redis/redis-stack-server:latest
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
start_period: 20s
interval: 30s
retries: 5
timeout: 3s
volumes:
- ./redis-data:/data # Same goes for redis
environment:
- "REDIS_ARGS=--notify-keyspace-events KEA"
api:
image: ghcr.io/openshock/api:latest
restart: unless-stopped
networks:
- openshock
depends_on:
- db
- redis
env_file: .env
environment:
OPENSHOCK__FRONTEND__BASEURL: https://${OPENSHOCK_DOMAIN:-openshock.local}
OPENSHOCK__FRONTEND__SHORTURL: https://${OPENSHOCK_DOMAIN:-openshock.local}
OPENSHOCK__FRONTEND__COOKIEDOMAIN: ${OPENSHOCK_DOMAIN:-openshock.local}
OPENSHOCK__DB__CONN: Host=db;Port=5432;Database=${PG_USER:-openshock};Username=${PG_USER:-openshock};Password=${PG_PASS}
OPENSHOCK__REDIS__HOST: redis
OPENSHOCK__TURNSTILE__ENABLE: false
labels:
- "traefik.enable=true"
- "traefik.http.routers.openshock-api.rule=Host(`${OPENSHOCK_API_SUBDOMAIN:-api}.${OPENSHOCK_DOMAIN:-openshock.local}`)"
- "traefik.http.routers.openshock-api.entrypoints=https"
- "traefik.http.routers.openshock-api.tls=true"
- "traefik.http.routers.openshock-api.service=openshock-api"
- "traefik.http.services.openshock-api.loadbalancer.server.port=80"
webui:
image: ghcr.io/openshock/webui:latest
restart: unless-stopped
networks:
- openshock
environment:
OPENSHOCK_NAME: OpenShock
OPENSHOCK_URL: ${OPENSHOCK_DOMAIN:-openshock.local}
OPENSHOCK_SHARE_URL: https://${OPENSHOCK_DOMAIN:-openshock.local}
OPENSHOCK_API_URL: https://${OPENSHOCK_API_SUBDOMAIN:-api}.${OPENSHOCK_DOMAIN:-openshock.local}
labels:
- "traefik.enable=true"
- "traefik.http.routers.openshock-webui.rule=Host(`${OPENSHOCK_DOMAIN:-openshock.local}`)"
- "traefik.http.routers.openshock-webui.entrypoints=https"
- "traefik.http.routers.openshock-webui.tls=true"
- "traefik.http.routers.openshock-webui.service=openshock-webui"
- "traefik.http.routers.openshock-webui.middlewares=osr-s,osr-c,osr-t"
- "traefik.http.services.openshock-webui.loadbalancer.server.port=80"
- "traefik.http.middlewares.osr-s.redirectregex.regex=^https://${OPENSHOCK_DOMAIN:-openshock.local}/s/(.*)"
- "traefik.http.middlewares.osr-s.redirectregex.replacement=https://${OPENSHOCK_DOMAIN:-openshock.local}/#/public/proxy/shares/links/$$1"
- "traefik.http.middlewares.osr-c.redirectregex.regex=^https://${OPENSHOCK_DOMAIN:-openshock.local}/c/(.*)"
- "traefik.http.middlewares.osr-c.redirectregex.replacement=https://${OPENSHOCK_DOMAIN:-openshock.local}/#/public/proxy/shares/code/$$1"
- "traefik.http.middlewares.osr-t.redirectregex.regex=^https://${OPENSHOCK_DOMAIN:-openshock.local}/t/(.*)"
- "traefik.http.middlewares.osr-t.redirectregex.replacement=https://${OPENSHOCK_DOMAIN:-openshock.local}/#/public/proxy/token/$$1"
lcg:
image: ghcr.io/openshock/live-control-gateway:latest
restart: unless-stopped
networks:
- openshock
depends_on:
- db
- redis
environment:
OPENSHOCK__REDIS__HOST: redis
OPENSHOCK__DB__CONN: Host=db;Port=5432;Database=${PG_USER:-openshock};Username=${PG_USER:-openshock};Password=${PG_PASS}
OPENSHOCK__LCG__COUNTRYCODE: DE
OPENSHOCK__LCG__FQDN: ${OPENSHOCK_GATEWAY_SUBDOMAIN:-gateway}.${OPENSHOCK_DOMAIN:-openshock.local}
labels:
- "traefik.enable=true"
- "traefik.http.routers.openshock-gateway.rule=Host(`${OPENSHOCK_GATEWAY_SUBDOMAIN:-gateway}.${OPENSHOCK_DOMAIN:-openshock.local}`)"
- "traefik.http.routers.openshock-gateway.entrypoints=https"
- "traefik.http.routers.openshock-gateway.tls=true"
- "traefik.http.routers.openshock-gateway.service=openshock-gateway"
- "traefik.http.services.openshock-gateway.loadbalancer.server.port=80"
cron:
image: ghcr.io/openshock/cron:master
restart: unless-stopped
networks:
- openshock
depends_on:
- db
- redis
environment:
OPENSHOCK__REDIS__HOST: redis
OPENSHOCK__DB__CONN: Host=db;Port=5432;Database=${PG_USER:-openshock};Username=${PG_USER:-openshock};Password=${PG_PASS}
labels:
- "traefik.enable=true"
- "traefik.http.routers.openshock-cron.rule=Host(`${OPENSHOCK_DOMAIN:-localhost}`) && PathPrefix(`/hangfire`)"
- "traefik.http.routers.openshock-cron.entrypoints=https"
- "traefik.http.routers.openshock-cron.tls=true"
- "traefik.http.routers.openshock-cron.service=openshock-cron"
- "traefik.http.services.openshock-cron.loadbalancer.server.port=780"
traefik:
image: traefik:latest
container_name: traefik
command:
#- "--log.level=DEBUG"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entryPoints.https.address=:443"
#- "--api.insecure=true"
restart: unless-stopped
networks:
- openshock
ports:
- 80:80
- 443:443
#- 8080:8080 # Traefik Web UI (enabled by --api.insecure=true)
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
openshock: