-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
95 lines (92 loc) · 3.51 KB
/
Copy pathdocker-compose.yml
File metadata and controls
95 lines (92 loc) · 3.51 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
# ─────────────────────────────────────────────────────────────
# Devonz (devonz.diy) — Docker Compose
# Local development & production profiles
#
# Usage:
# docker compose up -d → pull from GHCR + run
# docker compose up -d --build → build locally + run
# docker compose pull → pull latest image
# docker compose --profile dev up → dev mode (hot reload)
#
# First-time setup:
# cp .env.example .env.local → create env file (optional)
# Edit .env.local and add your API keys
# ─────────────────────────────────────────────────────────────
services:
# ── Production ────────────────────────────────────────────
# Pulls from GHCR by default. Use --build to build locally.
devonz:
image: ghcr.io/zebbern/devonz:latest
build:
context: .
dockerfile: Dockerfile
container_name: devonz
restart: unless-stopped
ports:
- "${PORT:-5173}:5173"
env_file:
- path: .env.local
required: false
environment:
- NODE_ENV=production
- RUNNING_IN_DOCKER=true
# Encryption key for API key cookie encryption.
# If not set, a random key is auto-generated on each startup
# (encrypted cookies will not persist across container restarts).
# For persistent encryption, generate a key and uncomment:
# node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
# - DEVONZ_ENCRYPTION_KEY=your_64_char_hex_key_here
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
labels:
- "com.centurylinklabs.watchtower.scope=devonz"
- "com.centurylinklabs.watchtower.enable=true"
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://localhost:5173/api/health').then(r=>{if(!r.ok)throw 1})"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
# ── Development (hot reload via bind mount) ───────────────
devonz-dev:
build:
context: .
dockerfile: Dockerfile
target: deps
container_name: devonz-dev
profiles: ["dev"]
ports:
- "${PORT:-5173}:5173"
env_file:
- path: .env.local
required: false
environment:
- NODE_ENV=development
volumes:
- .:/app
- /app/node_modules
command: pnpm dev
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://localhost:5173/api/health').then(r=>{if(!r.ok)throw 1})"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
# ── Auto-Update (optional) ───────────────────────────────
# Enable with: docker compose --profile auto-update up -d
# Polls GHCR every 5 minutes for new images and restarts
watchtower:
image: containrrr/watchtower
container_name: devonz-watchtower
profiles: ["auto-update"]
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_POLL_INTERVAL=300
- WATCHTOWER_INCLUDE_STOPPED=false
- WATCHTOWER_LABEL_ENABLE=true
command: --label-enable
labels:
- "com.centurylinklabs.watchtower.scope=devonz"