forked from OpenDataEnsemble/ode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
81 lines (76 loc) · 2.5 KB
/
docker-compose.yml
File metadata and controls
81 lines (76 loc) · 2.5 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
# Docker Compose configuration for Synkronus
# This setup includes:
# - PostgreSQL database (separate container)
# - Synkronus: single Go server (API + embedded portal)
#
# Usage:
# docker compose up -d # Start all services
# docker compose down # Stop all services
# docker compose logs -f # View logs
# docker compose ps # Check service status
services:
# PostgreSQL database
postgres:
image: postgres:17
container_name: synkronus-postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: your_password # CHANGE THIS IN PRODUCTION!
POSTGRES_DB: synkronus
volumes:
- postgres-data:/var/lib/postgresql/data
expose:
- "5432"
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
networks:
- synkronus-network
# Synkronus: single Go server (API + embedded portal)
synkronus:
build:
context: .
dockerfile: Dockerfile
container_name: synkronus
ports:
- "8080:80" # Host 8080 -> container 80 (Go server)
environment:
# Database connection - must match postgres service credentials
DB_CONNECTION: "postgres://postgres:your_password@postgres:5432/synkronus?sslmode=disable"
# JWT Secret (MUST be changed in production!)
# Generate with: openssl rand -base64 32
JWT_SECRET: "your-secret-key-minimum-32-characters-long" # CHANGE THIS IN PRODUCTION!
PORT: "80" # Go server listens on 80
LOG_LEVEL: "info" # Options: debug, info, warn, error
volumes:
- app-bundles:/app/data/app-bundles
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "-O", "-", "http://127.0.0.1/health"]
interval: 30s
timeout: 3s
retries: 3
start_period: 10s
networks:
- synkronus-network
# Named volumes for data persistence
# These volumes persist even when containers are stopped or removed
# They are only deleted if you explicitly use: docker compose down -v
volumes:
postgres-data:
driver: local
# This volume stores all PostgreSQL database data
# It persists across container restarts and mode switches
app-bundles:
driver: local
# This volume stores uploaded app bundle ZIP files
# It persists across container restarts and mode switches
networks:
synkronus-network:
driver: bridge