-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
59 lines (57 loc) · 2.1 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
59 lines (57 loc) · 2.1 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
# ---------------------------------------------------------------------------
# Development docker-compose — full stack
#
# Runs the server (API + bot merged) and the web front-end all inside Docker.
# Source files are mounted as volumes so you can edit code without rebuilding:
#
# Server — edit packages/server/src, then `docker compose restart alfira`.
# Web — edit packages/web/src, rebuild the image to see changes.
#
# First-time setup:
# cp .env.example .env
# fill in all values
#
# Usage:
# docker compose -f docker-compose.dev.yml up --build — build images and start all services
# docker compose -f docker-compose.dev.yml up -d — start in the background (after first build)
# docker compose -f docker-compose.dev.yml down — stop and remove containers
# docker compose -f docker-compose.dev.yml down -v — stop and wipe all data (clean slate)
# docker compose -f docker-compose.dev.yml restart alfira — reload the server after TypeScript changes
# ---------------------------------------------------------------------------
services:
alfira:
build:
context: .
dockerfile: Dockerfile
target: dev
restart: unless-stopped
env_file:
# Local .env file provides Discord tokens, OAuth secrets, JWT secret, etc.
# Copy .env.example to .env and fill in real values before first run.
- .env
environment:
NODE_ENV: development
DATABASE_URL: /data/alfira.db
ports:
- '3001:3001'
volumes:
# Live-mount server source files — restart the service to pick up changes.
- ./packages/server/src:/app/packages/server/src
# Mount .git so resolveVersion() can read the commit hash
- ./.git:/app/.git:ro
# Persistent SQLite database storage
- alfira-data:/data
healthcheck:
test:
[
'CMD',
'bun',
'-e',
"fetch('http://localhost:3001/health').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
alfira-data: