-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
122 lines (114 loc) · 3.12 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
122 lines (114 loc) · 3.12 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
# ============================================================
# OneERP Production Docker Compose
# Usage: docker compose -f docker-compose.prod.yml up -d
# ============================================================
version: '3.8'
services:
# ---- PostgreSQL Database ----
db:
image: postgres:15-alpine
container_name: oneerp_postgres
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER:-eip_user}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB:-eip_db}
ports:
- "${DB_PORT:-5432}:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-eip_user}"]
interval: 10s
timeout: 5s
retries: 5
# ---- Redis Cache ----
redis:
image: redis:7-alpine
container_name: oneerp_redis
restart: always
command: redis-server --requirepass ${REDIS_PASSWORD:-}
ports:
- "${REDIS_PORT:-6379}:6379"
volumes:
- redisdata:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# ---- MinIO Object Storage ----
minio:
image: minio/minio:latest
container_name: oneerp_minio
restart: always
environment:
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY:-minio_admin}
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY}
ports:
- "${MINIO_API_PORT:-9000}:9000"
- "${MINIO_CONSOLE_PORT:-9001}:9001"
command: server /data --console-address ":9001"
volumes:
- miniodata:/data
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 10s
timeout: 5s
retries: 5
# ---- NestJS API ----
api:
image: ${REGISTRY:-ghcr.io}/${IMAGE_OWNER:-your-org}/oneerp-api:latest
container_name: oneerp_api
restart: always
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
environment:
NODE_ENV: production
DATABASE_URL: postgresql://${POSTGRES_USER:-eip_user}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB:-eip_db}
JWT_SECRET: ${JWT_SECRET}
REDIS_HOST: redis
REDIS_PORT: 6379
MINIO_ENDPOINT: minio
MINIO_PORT: 9000
MINIO_USE_SSL: "false"
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY:-minio_admin}
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY}
PORT: ${API_PORT:-8000}
ports:
- "${API_PORT:-8000}:8000"
# ---- Next.js Web ----
web:
image: ${REGISTRY:-ghcr.io}/${IMAGE_OWNER:-your-org}/oneerp-web:latest
container_name: oneerp_web
restart: always
depends_on:
- api
environment:
NODE_ENV: production
NEXT_PUBLIC_API_URL: http://api:${API_PORT:-8000}
ports:
- "${WEB_PORT:-3000}:3000"
# ---- Nginx Reverse Proxy (optional) ----
nginx:
image: nginx:alpine
container_name: oneerp_nginx
restart: always
depends_on:
- api
- web
ports:
- "${HTTP_PORT:-80}:80"
- "${HTTPS_PORT:-443}:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/ssl:/etc/nginx/ssl:ro
profiles:
- with-nginx
volumes:
pgdata:
redisdata:
miniodata: