-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
82 lines (77 loc) · 2.38 KB
/
docker-compose.dev.yml
File metadata and controls
82 lines (77 loc) · 2.38 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
version: '3.8'
services:
traefik:
image: traefik:v3.0
container_name: hsc-traefik
restart: unless-stopped
ports:
- "80:80" # HTTP
- "443:443" # HTTPS
- "8081:8080" # Traefik dashboard
volumes:
# Docker socket access for automatic service discovery
- /var/run/docker.sock:/var/run/docker.sock:ro
# Traefik configuration file
- ./traefik/traefik.yml:/etc/traefik/traefik.yml:ro
# Let's Encrypt certificate storage
- traefik-acme:/acme
# Traefik labels for configuring its own dashboard
labels:
- "traefik.enable=true"
- "traefik.http.routers.dashboard.rule=Host(`traefik.${DOMAIN:-localhost}`)"
- "traefik.http.routers.dashboard.service=api@internal"
postgres:
image: postgres:15
container_name: hsc-postgres-dev
environment:
POSTGRES_DB: healthshadow_dev
POSTGRES_USER: hsc_user
POSTGRES_PASSWORD: hsc_dev_password
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./db/init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U hsc_user -d healthshadow_dev"]
interval: 10s
timeout: 5s
retries: 5
app:
image: hsc-http:latest
container_name: hsc-app-dev
ports:
- "8080:8080"
depends_on:
- postgres
environment:
- DATABASE_URL=jdbc:postgresql://postgres:5432/healthshadow_dev
- DATABASE_USER=hsc_user
- DATABASE_PASSWORD=hsc_dev_password
- HOST=0.0.0.0
# Centralized logging configuration
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Health check configuration
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Traefik labels for automatic service discovery and routing
labels:
- "traefik.enable=true"
- "traefik.http.routers.hsc-app.rule=Host(`${DOMAIN:-shadowconnects.localhost}`)"
- "traefik.http.routers.hsc-app.entrypoints=websecure"
- "traefik.http.routers.hsc-app.tls.certresolver=letsencrypt"
- "traefik.http.services.hsc-app.loadbalancer.server.port=8080"
volumes:
postgres_data:
driver: local
# Let's Encrypt certificate storage for automatic SSL
traefik-acme:
driver: local