-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
107 lines (98 loc) · 2.59 KB
/
Copy pathdocker-compose.yml
File metadata and controls
107 lines (98 loc) · 2.59 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
# One-command local stack for Comms: Postgres + Redis + MinIO (S3) + web + worker.
#
# docker compose up --build
# → open http://localhost:3000 and run the setup wizard
#
# Note: no APP_SECRET is set — the app generates and stores one on first boot,
# demonstrating the minimal-config setup. Attachments use the bundled MinIO.
x-app: &app
build:
context: .
dockerfile: Dockerfile
image: comms:local
environment: &app-env
NODE_ENV: production
DATABASE_URL: postgres://postgres:postgres@postgres:5432/comms
REDIS_URL: redis://redis:6379
S3_ENDPOINT: http://minio:9000
S3_REGION: us-east-1
S3_ACCESS_KEY_ID: minioadmin
S3_SECRET_ACCESS_KEY: minioadmin
S3_BUCKET: comms
S3_FORCE_PATH_STYLE: "true"
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: comms
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d comms"]
interval: 3s
timeout: 3s
retries: 20
redis:
image: redis:7-alpine
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 3s
timeout: 3s
retries: 20
minio:
image: minio/minio:latest
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- "9000:9000"
- "9001:9001"
volumes:
- miniodata:/data
# One-shot: create the attachments bucket once MinIO is up.
createbucket:
image: minio/mc:latest
depends_on:
minio:
condition: service_started
entrypoint: >
/bin/sh -c "
until mc alias set local http://minio:9000 minioadmin minioadmin; do sleep 1; done;
mc mb --ignore-existing local/comms;
exit 0;
"
# One-shot: apply database migrations before web/worker start.
migrate:
<<: *app
command: ["node", "packages/db/dist/migrate.js"]
depends_on:
postgres:
condition: service_healthy
web:
<<: *app
command: ["pnpm", "--filter", "@comms/web", "start"]
environment:
<<: *app-env
PORT: "3000"
APP_URL: http://localhost:3000
ports:
- "3000:3000"
depends_on:
redis:
condition: service_healthy
migrate:
condition: service_completed_successfully
worker:
<<: *app
command: ["node", "apps/worker/dist/index.js"]
depends_on:
redis:
condition: service_healthy
migrate:
condition: service_completed_successfully
volumes:
pgdata:
miniodata: