-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
106 lines (95 loc) · 3.33 KB
/
Copy pathdocker-compose.yml
File metadata and controls
106 lines (95 loc) · 3.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
98
99
100
101
102
103
104
105
106
version: "3.9"
# _vaultr — local infrastructure with containerized app
# Run: docker compose up -d
# Stop: docker compose down (data in named volumes is preserved)
services:
app:
image: ghcr.io/yashraj-jangra/vaultr:latest
container_name: vaultr_app
restart: always
ports:
- "3005:3000" # Access Vaultr at http://<host-ip>:3005
environment:
# Database Connection Details (points to postgres service on the same network)
- DB_USER=${DB_USER:-vaultr}
- DB_PASSWORD=${DB_PASSWORD:?DB_PASSWORD is required}
- DB_NAME=${DB_NAME:-vaultr_db}
- DATABASE_URL=postgresql://${DB_USER:-vaultr}:${DB_PASSWORD}@postgres:5432/${DB_NAME:-vaultr_db}
# MinIO Configuration
- MINIO_ENDPOINT=http://minio:9000
- MINIO_PUBLIC_URL=${MINIO_PUBLIC_URL:-}
- MINIO_ROOT_USER=${MINIO_ROOT_USER:-vaultr}
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD:?MINIO_ROOT_PASSWORD is required}
- MINIO_BUCKET_AVATARS=${MINIO_BUCKET_AVATARS:-avatars}
# Better Auth & URL Configuration
- BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET:?BETTER_AUTH_SECRET is required}
- BETTER_AUTH_URL=${BETTER_AUTH_URL:?BETTER_AUTH_URL is required}
- NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL:?NEXT_PUBLIC_APP_URL is required}
- TRUSTED_ORIGINS=${TRUSTED_ORIGINS}
# Google OAuth (optional — leave unset to disable Google sign-in)
- GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID}
- GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET}
# Email / SMTP (optional)
- SMTP_HOST=${SMTP_HOST}
- SMTP_PORT=${SMTP_PORT}
- SMTP_USER=${SMTP_USER}
- SMTP_PASS=${SMTP_PASS}
- SMTP_FROM=${SMTP_FROM}
# MinIO Attachments bucket
- MINIO_BUCKET_ATTACHMENTS=${MINIO_BUCKET_ATTACHMENTS:-attachments}
depends_on:
postgres:
condition: service_healthy
minio:
condition: service_healthy
networks:
- vaultr_net
postgres:
image: postgres:16-alpine
container_name: vaultr_postgres
restart: always
environment:
POSTGRES_USER: ${DB_USER:-vaultr}
POSTGRES_PASSWORD: ${DB_PASSWORD:?DB_PASSWORD is required}
POSTGRES_DB: ${DB_NAME:-vaultr_db}
volumes:
- pgdata:/var/lib/postgresql/data
ports:
- "127.0.0.1:5435:5432" # Bound to localhost on a unique port (5435) to avoid conflict
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${DB_USER:-vaultr} -d ${DB_NAME:-vaultr_db}" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
networks:
- vaultr_net
minio:
image: quay.io/minio/minio:latest
container_name: vaultr_minio
restart: always
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-vaultr}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:?MINIO_ROOT_PASSWORD is required}
volumes:
- miniodata:/data
ports:
- "9005:9000" # Exposed unique port (9005) for S3 API
- "9011:9001" # Exposed unique port (9011) for MinIO web console
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9000/minio/health/live" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
networks:
- vaultr_net
volumes:
pgdata:
name: vaultr_pgdata
miniodata:
name: vaultr_miniodata
networks:
vaultr_net:
name: vaultr_network