-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
77 lines (72 loc) · 1.91 KB
/
Copy pathdocker-compose.yml
File metadata and controls
77 lines (72 loc) · 1.91 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
name: stackfile
services:
postgres:
image: postgres:17-alpine
restart: unless-stopped
environment:
POSTGRES_USER: stackfile
POSTGRES_PASSWORD: stackfile
POSTGRES_DB: stackfile
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U stackfile -d stackfile"]
interval: 5s
timeout: 5s
retries: 10
ports:
- "5544:5432"
redis:
image: redis:7-alpine
restart: unless-stopped
volumes:
- redisdata:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
ports:
- "6379:6379"
# One-shot migrations (uses the build stage which has drizzle-kit + source).
migrate:
build:
context: .
target: build
command: pnpm db:migrate
environment:
DATABASE_URL: postgres://stackfile:stackfile@postgres:5432/stackfile
depends_on:
postgres:
condition: service_healthy
app:
build:
context: .
target: runner
restart: unless-stopped
environment:
NODE_ENV: production
PORT: 4000
APP_URL: ${APP_URL:-http://localhost:4000}
DATABASE_URL: postgres://stackfile:stackfile@postgres:5432/stackfile
REDIS_URL: redis://redis:6379
BETTER_AUTH_SECRET: ${BETTER_AUTH_SECRET:-change-me-please-use-a-long-random-string}
BETTER_AUTH_URL: ${APP_URL:-http://localhost:4000}
STORAGE_DRIVER: local
STORAGE_LOCAL_PATH: /data/storage
volumes:
# Bind-mount the host store so a single-machine self-host shares one
# storage location between local dev and the container.
- ./storage-data:/data/storage
ports:
- "4000:4000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
migrate:
condition: service_completed_successfully
volumes:
pgdata:
redisdata: