-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
133 lines (124 loc) · 4.07 KB
/
docker-compose.yml
File metadata and controls
133 lines (124 loc) · 4.07 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
services:
bandada:
# https://github.com/bandada-infra/bandada/blob/f92d71681f9f268e46ce1ab41b11c9e5622fb29c/docker-compose.prod.yml#L9C16-L9C75
container_name: pse-forum-bandada
depends_on:
migrate:
condition: service_completed_successfully
postgres:
condition: service_healthy
environment:
API_URL: http://localhost:3000
DB_SCHEMA: bandada
DB_TYPE: postgres
DB_URL: postgres://postgres:postgres@postgres:5432/postgres
IRON_SESSION_PASSWORD: thirty-two-characters-long-random-string
healthcheck:
test: ["CMD", "pgrep", "-f", "node"]
interval: 1s
start_period: 3s
timeout: 5s
image: ghcr.io/sripwoud/bandada-api:latest
ports: ["3001:3000"]
restart: unless-stopped
client:
container_name: pse-forum-client
#depends_on:
# server:
# condition: service_healthy
environment:
VITE_SERVER_URL: http://server:3000
image: ghcr.io/privacy-scaling-explorations/pse-forums-client:latest
ports: ["80:80"]
# used during local development only
mail:
container_name: pse-forum-mail
image: inbucket/inbucket:stable
ports: ["9000:9000", "2500:2500", "1100:1100"]
restart: unless-stopped
migrate:
container_name: pse-forum-migrate
depends_on:
postgres:
condition: service_healthy
entrypoint: ["/bin/sh", "-c", "/migrate.sh"]
environment:
# env var used by psql and pg_isready (not postgres server which uses POSTGRES_PASSWORD)
PGHOST: postgres
PGUSER: postgres
PGPASSWORD: postgres
PGDATABASE: postgres
image: postgres:latest
restart: "no"
volumes:
[
"./apps/server/db/migrations:/migrations",
"./apps/server/db/migrate.sh:/migrate.sh",
]
server:
container_name: pse-forum-server
depends_on:
bandada:
condition: service_healthy
migrate:
condition: service_completed_successfully
postgres:
condition: service_healthy
environment:
BANDADA_URL: http://bandada:3000
CLIENT_URL: "${EXT_CLIENT_URL:-https://ui.aforum.click}" # must be url on external network (not docker's), with docker compose the client is served with nginx on port 80
DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
EMAIL_FROM: "${EMAIL_FROM:-pse-forum@noreply.com}"
EMAIL_HOST: pse-forum-mail # mail service container name if using inbucket
EMAIL_PORT: "${EMAIL_PORT:-2500}"
JWT_SECRET: "${JWT_SECRET:-secret}"
LOKI_URL: http://loki:3100
USE_INBUCKET: "${USE_INBUCKET:-false}"
VITE_SERVER_URL: "${VITE_SERVER_URL:-http://localhost:3000}"
image: ghcr.io/privacy-scaling-explorations/pse-forums-server:latest
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 5s
retries: 3
start_period: 10s
timeout: 3s
ports: ["3000:3000"]
postgres:
container_name: pse-forum-postgres
environment:
PGUSER: postgres # used by pg_isready
POSTGRES_PASSWORD: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
image: postgres:latest
restart: unless-stopped
ports: ["5432:5432"]
volumes: [bandada:/var/lib/postgresql/data]
loki:
container_name: pse-forum-loki
command: -config.file=/etc/loki/config.yaml
image: grafana/loki:latest
ports: ["3100:3100"]
volumes: [./loki-config.yaml:/etc/loki/config.yaml]
grafana:
container_name: pse-forum-grafana
depends_on: [loki]
environment:
GF_SECURITY_ADMIN_PASSWORD: admin
GF_SECURITY_ADMIN_USER: admin
image: grafana/grafana:latest
ports: ["3002:3000"]
volumes: [grafana:/var/lib/grafana]
promtail:
container_name: pse-forum-promtail
command: -config.file=/etc/promtail/config.yaml
depends_on: [loki]
image: grafana/promtail:latest
volumes: [
./promtail-config.yaml:/etc/promtail/config.yaml,
/var/lib/promtail:/var/lib/promtail,
/var/run/docker.sock:/var/run/docker.sock, # allow access to docker logs
]
volumes:
bandada:
grafana: