-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.production.yml
More file actions
137 lines (129 loc) · 4.06 KB
/
docker-compose.production.yml
File metadata and controls
137 lines (129 loc) · 4.06 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
# ============================================================================
# Betterbase Production Docker Compose
#
# Production-ready configuration with all services.
# Requires .env file with proper values.
#
# Usage:
# cp .env.example .env
# # Edit .env with your values
# docker compose -f docker-compose.production.yml up -d
# ============================================================================
services:
postgres:
image: postgres:16-alpine
container_name: betterbase-postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-betterbase}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-betterbase}
POSTGRES_DB: ${POSTGRES_DB:-betterbase}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-betterbase}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- betterbase-network
minio:
image: minio/minio:RELEASE.2024-11-07T19-31-41Z
container_name: betterbase-minio
restart: unless-stopped
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${STORAGE_ACCESS_KEY:-minioadmin}
MINIO_ROOT_PASSWORD: ${STORAGE_SECRET_KEY:-minioadmin}
volumes:
- minio_data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 10s
timeout: 5s
retries: 5
networks:
- betterbase-network
minio-init:
image: minio/mc:RELEASE.2024-11-08T03-47-05Z
container_name: betterbase-minio-init
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set local http://minio:9000 ${STORAGE_ACCESS_KEY:-minioadmin} ${STORAGE_SECRET_KEY:-minioadmin};
mc mb --ignore-existing local/betterbase;
echo 'MinIO bucket initialized.';
"
networks:
- betterbase-network
inngest:
image: inngest/inngest:v1.17.5
container_name: betterbase-inngest
restart: unless-stopped
command: inngest start --host 0.0.0.0 --port 8288
environment:
INNGEST_LOG_LEVEL: ${INNGEST_LOG_LEVEL:-info}
volumes:
- inngest_data:/data
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:8288/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
networks:
- betterbase-network
betterbase-server:
build:
context: .
dockerfile: packages/server/Dockerfile
container_name: betterbase-server
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
minio:
condition: service_healthy
minio-init:
condition: service_completed_successfully
inngest:
condition: service_healthy
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-betterbase}:${POSTGRES_PASSWORD:-betterbase}@postgres:5432/${POSTGRES_DB:-betterbase}
BETTERBASE_JWT_SECRET: ${BETTERBASE_JWT_SECRET:?JWT secret required - set BETTERBASE_JWT_SECRET in .env}
BETTERBASE_PUBLIC_URL: ${BETTERBASE_PUBLIC_URL:-http://localhost:3000}
STORAGE_ENDPOINT: http://minio:9000
STORAGE_ACCESS_KEY: ${STORAGE_ACCESS_KEY:-minioadmin}
STORAGE_SECRET_KEY: ${STORAGE_SECRET_KEY:-minioadmin}
STORAGE_BUCKET: betterbase
PORT: "3001"
NODE_ENV: production
CORS_ORIGINS: ${CORS_ORIGINS:-http://localhost}
INNGEST_BASE_URL: http://inngest:8288
INNGEST_SIGNING_KEY: ${INNGEST_SIGNING_KEY:-}
INNGEST_EVENT_KEY: ${INNGEST_EVENT_KEY:-}
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:3001/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
networks:
- betterbase-network
dashboard:
image: nginx:alpine
container_name: betterbase-dashboard
restart: unless-stopped
volumes:
- ./apps/dashboard/dist:/usr/share/nginx/html:ro
depends_on:
- betterbase-server
networks:
- betterbase-network
volumes:
postgres_data:
minio_data:
inngest_data:
networks:
betterbase-network:
driver: bridge