-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
97 lines (92 loc) · 2.33 KB
/
docker-compose.yml
File metadata and controls
97 lines (92 loc) · 2.33 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
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: rancher-hub-postgres
restart: unless-stopped
environment:
POSTGRES_DB: rancher_hub
POSTGRES_USER: rancher_hub
POSTGRES_PASSWORD: rancher_hub_password
POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --lc-collate=C --lc-ctype=C"
volumes:
- ./postgres_data:/var/lib/postgresql/data
- ./init-scripts:/docker-entrypoint-initdb.d
ports:
- "5432:5432"
networks:
- rancher-hub-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U rancher_hub -d rancher_hub"]
interval: 10s
timeout: 5s
retries: 5
# Backend API Service
backend:
image: thanhtunguet/rancher-hub-backend:latest
container_name: rancher-hub-backend
restart: unless-stopped
environment:
NODE_ENV: production
PORT: 3000
DATABASE_TYPE: postgres
DATABASE_HOST: postgres
DATABASE_PORT: 5432
DATABASE_NAME: rancher_hub
DATABASE_USERNAME: rancher_hub
DATABASE_PASSWORD: rancher_hub_password
DATABASE_SSL: false
DATABASE_SYNCHRONIZE: true
FRONTEND_URL: http://localhost:8080
JWT_SECRET: your-super-secret-jwt-key-change-in-production
depends_on:
postgres:
condition: service_healthy
networks:
- rancher-hub-network
healthcheck:
test: ["CMD", "node", "healthcheck.js"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Frontend Service
frontend:
image: thanhtunguet/rancher-hub-frontend:latest
container_name: rancher-hub-frontend
restart: unless-stopped
networks:
- rancher-hub-network
# Nginx Reverse Proxy
nginx:
image: nginx:stable-alpine
container_name: rancher-hub-nginx
restart: unless-stopped
ports:
- "8080:80"
volumes:
- ./nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- backend
- frontend
networks:
- rancher-hub-network
healthcheck:
test:
[
"CMD",
"wget",
"--quiet",
"--tries=1",
"--spider",
"http://localhost/health",
]
interval: 30s
timeout: 10s
retries: 3
volumes:
postgres_data:
driver: local
networks:
rancher-hub-network:
driver: bridge