-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
74 lines (70 loc) · 2.68 KB
/
docker-compose.yml
File metadata and controls
74 lines (70 loc) · 2.68 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
version: '3.8'
# =============================================================================
# WARNING: DATABASE PERSISTENCE
# =============================================================================
# The db_data volume stores all PostgreSQL data.
# DO NOT run "docker compose down -v" in production - this will DELETE ALL DATA!
# Use "docker compose down" (without -v) to stop services while keeping data.
# =============================================================================
services:
# =============================================================================
# PostgreSQL Database
# =============================================================================
db:
image: postgres:15-alpine
container_name: pingpoint-db
restart: unless-stopped
environment:
POSTGRES_DB: pingpoint
POSTGRES_USER: pingpoint
# IMPORTANT: In production, POSTGRES_PASSWORD must be set in .env file
# Never use the default password in production!
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
volumes:
# Named volume for data persistence - survives container restarts
- db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U pingpoint -d pingpoint"]
interval: 10s
timeout: 5s
retries: 5
# =============================================================================
# PingPoint Application
# =============================================================================
app:
build: .
container_name: pingpoint-app
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
NODE_ENV: production
PORT: 8080
DATABASE_URL: postgres://pingpoint:${POSTGRES_PASSWORD:-pingpoint_password}@db:5432/pingpoint
PGHOST: db
PGPORT: 5432
PGUSER: pingpoint
PGPASSWORD: ${POSTGRES_PASSWORD:-pingpoint_password}
RESEND_API_KEY: ${RESEND_API_KEY:-}
JWT_SECRET: ${JWT_SECRET:-change_this_in_production_min_32_chars!}
PINGPOINT_PUBLIC_URL: ${PINGPOINT_PUBLIC_URL:-http://localhost:8080}
MAIL_FROM: ${MAIL_FROM:-no-reply@yourdomain.com}
ports:
- "8080:8080"
volumes:
- uploads_data:/app/uploads
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/api/health"]
interval: 30s
timeout: 10s
start_period: 30s
retries: 3
volumes:
# CRITICAL: db_data contains all database content
# This volume must be backed up regularly in production
# Never delete this volume unless you intend to lose all data
db_data:
name: pingpoint_db_data
uploads_data:
name: pingpoint_uploads