-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
93 lines (85 loc) · 2.13 KB
/
docker-compose.yaml
File metadata and controls
93 lines (85 loc) · 2.13 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
version: '3.9'
services:
# PostgreSQL Database
postgres:
image: postgres:16-alpine
container_name: slotswapper-db
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres123
POSTGRES_DB: slotswapper_dev
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
networks:
- slotswapper-network
# Backend Go API
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: slotswapper-backend
restart: unless-stopped
ports:
- "8080:8080"
environment:
# Server Configuration
PORT: 8080
GIN_MODE: release
ENVIRONMENT: production
# Database Configuration
DB_HOST: postgres
DB_PORT: 5432
DB_USER: postgres
DB_PASSWORD: postgres123
DB_NAME: slotswapper_dev
DB_SSLMODE: disable
# JWT Configuration
JWT_SECRET: your-super-secret-jwt-key-change-in-production-32-chars
JWT_EXPIRATION_HOURS: 24
# CORS Configuration (allow frontend container and localhost)
ALLOWED_ORIGINS: "http://localhost,http://localhost:80,http://frontend,http://frontend:80"
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "/slotswapper", "healthcheck"]
interval: 30s
timeout: 3s
retries: 3
start_period: 10s
networks:
- slotswapper-network
# Frontend Vue.js + Nginx
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
VITE_API_BASE_URL: /api
container_name: slotswapper-frontend
restart: unless-stopped
ports:
- "80:80"
depends_on:
- backend
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:80/"]
interval: 30s
timeout: 3s
retries: 3
networks:
- slotswapper-network
volumes:
postgres_data:
driver: local
networks:
slotswapper-network:
driver: bridge