-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose-sample.yml
More file actions
141 lines (131 loc) · 4.43 KB
/
docker-compose-sample.yml
File metadata and controls
141 lines (131 loc) · 4.43 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# ============================================
# Jet Admin - Ready-to-Run Docker Compose (Separated Services)
# ============================================
# 3 Services: frontend, backend, postgres
#
# Usage:
# docker compose -f docker-compose.sample.yml up -d --build
#
# Services:
# - frontend: React app served by nginx (port 80)
# - backend: Node.js API server (port 8090)
# - postgres: PostgreSQL database
services:
# ============================================
# Frontend - React App (nginx)
# ============================================
frontend:
build:
context: .
dockerfile: Dockerfile.frontend
args:
- VITE_FIREBASE_API_KEY=your_firebase_api_key
- VITE_FIREBASE_AUTH_DOMAIN=your_project_id.firebaseapp.com
- VITE_FIREBASE_PROJECT_ID=your_project_id
- VITE_FIREBASE_STORAGE_BUCKET=your_project_id.firebasestorage.app
- VITE_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id
- VITE_FIREBASE_APP_ID=your_app_id
- VITE_FIREBASE_MEASUREMENT_ID=your_measurement_id
- VITE_SUPABASE_URL=your_supabase_url
- VITE_SUPABASE_KEY=your_supabase_anon_key
container_name: jet-admin-frontend
ports:
- "80:80" # Main application access point
depends_on:
backend:
condition: service_healthy
networks:
- jet-network
environment:
- VITE_SERVER_HOST=http://localhost:8090
- VITE_SOCKET_HOST=http://localhost:8090
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost/health"]
interval: 30s
timeout: 10s
retries: 3
# ============================================
# Backend - Node.js API Server
# ============================================
backend:
build:
context: .
dockerfile: Dockerfile.backend
container_name: jet-admin-backend
ports:
- "8090:8090" # API direct access (optional, for debugging)
depends_on:
postgres:
condition: service_healthy
environment:
# Server Configuration
- NODE_ENV=production
- PORT=8090
# Database Configuration
- DATABASE_URL=postgresql://postgres:your_strong_password@postgres:5432/jet_admin_db
- SEED_DATABASE=true # Set to false after first run
# Authentication Secrets
- JWT_ACCESS_TOKEN_SECRET=your_super_secret_access_token_key_change_me
- JWT_REFRESH_TOKEN_SECRET=your_super_secret_refresh_token_key_change_me
- ACCESS_TOKEN_TIMEOUT=900
- REFRESH_TOKEN_TIMEOUT=100h
- SESSION_SECRET=your_session_secret_change_me
# AI Configuration
- GEMINI_API_KEY=your_gemini_api_key
# Modules Configuration
- ENABLED_MODULES=auth,tenant,database,datasource,dataQuery,workflow,widget,dashboard,userManagement,role,apiKey,cronJob,audit,ai,notification,permission
- NODE_ID=docker_node_1
# Logging
- LOG_LEVEL=info
- EXPRESS_REQUEST_SIZE_LIMIT=5mb
- CORS_WHITELIST=http://localhost,http://frontend,http://localhost:3000
volumes:
- backend_logs:/app/apps/backend/logs
networks:
- jet-network
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8090/health"]
interval: 30s
timeout: 10s
start_period: 30s
retries: 3
# ============================================
# PostgreSQL Database
# ============================================
postgres:
image: postgres:15-alpine
container_name: jet-admin-postgres
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=your_strong_password
- POSTGRES_DB=jet_admin_db
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432" # Exposed for debugging; remove in production
networks:
- jet-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d jet_admin_db"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
# ============================================
# Volumes
# ============================================
volumes:
postgres_data:
name: jet-admin-postgres-data
backend_logs:
name: jet-admin-backend-logs
# ============================================
# Networks
# ============================================
networks:
jet-network:
name: jet-admin-network
driver: bridge