-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
140 lines (118 loc) · 3.75 KB
/
docker-compose.yml
File metadata and controls
140 lines (118 loc) · 3.75 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
134
135
136
137
138
139
140
services:
app:
image: jarebear/invigo-server:latest
container_name: invigo_server
# App will not start until Postgres passes pg_isready
# This prevents connection storms and startup crashes
depends_on:
db:
condition: service_healthy
puppeteer:
condition: service_started
restart: unless-stopped
environment:
# ======================
# Application settings
# ======================
PORT: 5057
PYTHONPATH: /app
DATA_PATH: /app/data
TZ: America/Winnipeg
PUPPETEER_URL: http://127.0.0.1:3000
# ======================
# Database connection
# ======================
# Uses Docker DNS (service name `db`)
POSTGRES_USER: admin
POSTGRES_PASSWORD: "PostgresPassword123!"
POSTGRES_HOST: db
POSTGRES_PORT: 5432
POSTGRES_DB: invigo
POSTGRES_WORKSPACE_DB: workspace
# ======================
# Connection pooling / safety
# ======================
# Prevents runaway connections and stale sockets
POSTGRES_MIN_CONNECTIONS: 5
POSTGRES_MAX_CONNECTIONS: 20
POSTGRES_TIMEOUT: 60
POSTGRES_COMMAND_TIMEOUT: 60
POSTGRES_MAX_INACTIVE_CONNECTION_LIFETIME: 60
# Background cache warm-up interval (seconds)
WORKSPACE_BACKGROUND_CACHE_WARM_UP_INTERVAL: 60
ports:
# Exposes app to host
- "5057:5057"
volumes:
# Old Synology mount (commented out)
# - /volume1/Invigo/Server:/app/data
# Active bind mount for application data
# Explicit host path avoids Portainer-managed volumes
- /mnt/SafeHaven/Forge/Invigo-Server:/app/data
db:
image: postgres:18.1
container_name: invigo_db
restart: unless-stopped
# Healthcheck is critical for depends_on gating
# pg_isready confirms Postgres is accepting connections
healthcheck:
test: ["CMD-SHELL", "pg_isready -U admin"]
interval: 5s
timeout: 5s
retries: 10
environment:
# Initial database created on first init only
POSTGRES_DB: invigo
POSTGRES_USER: admin
POSTGRES_PASSWORD: "PostgresPassword123!"
TZ: America/Winnipeg
volumes:
# ======================
# DATA PERSISTENCE (READ THIS)
# ======================
#
# Use EITHER:
# - a named volume (pgdata)
# OR:
# - a bind mount (/volume1/Invigo/Postgres)
#
# NEVER both.
#
# Mixing a named volume and a bind mount on /var/lib/postgresql
# will cause mount shadowing and silent data loss.
#
# If you enable the bind mount below:
# - REMOVE pgdata from this service
# - REMOVE the `volumes: pgdata:` block at the bottom
#
# CURRENT (named volume)
# Docker-managed volume, opaque and Portainer-scoped
# Safe ONLY if stack name never changes and volumes are never removed
- pgdata:/var/lib/postgresql
# RECOMMENDED (bind mount)
# Explicit host path, SMB-visible, immune to Portainer redeploys
# - /volume1/Invigo/Postgres:/var/lib/postgresql
ports:
# Exposes Postgres to host (optional; remove if not needed externally)
- "5432:5432"
puppeteer:
image: jarebear/invigo-puppeteer:latest
working_dir: /srv
volumes:
- /mnt/SafeHaven/Forge/Invigo-Server/scripts:/srv/scripts:ro
command: ["node", "/srv/scripts/puppeteer-server.js"]
expose:
- "3000"
shm_size: "1gb"
init: true
volumes:
# ======================
# NAMED VOLUME DEFINITION
# ======================
#
# This MUST be removed if a bind mount is used above.
#
# Leaving this defined while using a bind mount is a foot-gun:
# Portainer or a future edit can reattach it and hide real data.
#
pgdata: