-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
105 lines (98 loc) · 3.11 KB
/
docker-compose.dev.yml
File metadata and controls
105 lines (98 loc) · 3.11 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
x-minio-env: &minio-env
MINIO_ROOT_USER: ${AWS_ACCESS_KEY_ID:-minioadmin}
MINIO_ROOT_PASSWORD: ${AWS_SECRET_ACCESS_KEY:-minioadmin}
MINIO_API_CORS_ALLOW_ORIGIN: ${MINIO_API_CORS_ALLOW_ORIGIN:-http://127.0.0.1:3000,http://localhost:3000}
x-minio-aws-env: &minio-aws-env
AWS_REGION: ${AWS_REGION:-us-east-1}
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:-minioadmin}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY:-minioadmin}
x-minio-dev-bucket: &minio-dev-bucket ${S3_BUCKET:-life-ustc-dev}
x-minio-internal-endpoint: &minio-internal-endpoint ${MINIO_INTERNAL_ENDPOINT:-http://minio:9000}
services:
postgres:
image: postgres:16
container_name: life-ustc-postgres-dev
environment:
POSTGRES_DB: life_ustc_dev
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "127.0.0.1:5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 10
volumes:
- postgres-data-dev:/var/lib/postgresql/data
minio:
image: ${MINIO_IMAGE:-minio/minio:RELEASE.2025-09-07T16-13-09Z-cpuv1}
container_name: ${MINIO_CONTAINER_NAME:-life-ustc-minio-dev}
environment: *minio-env
command: server /data --console-address ":9001"
ports:
- "127.0.0.1:${MINIO_PORT:-9000}:9000"
- "127.0.0.1:${MINIO_CONSOLE_PORT:-9001}:9001"
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://127.0.0.1:9000/minio/health/live || exit 1"]
interval: 5s
timeout: 5s
retries: 10
volumes:
- minio-data-dev:/data
minio-setup:
image: ${MINIO_CLIENT_IMAGE:-minio/mc:RELEASE.2025-08-13T08-35-41Z-cpuv1}
container_name: life-ustc-minio-setup-dev
depends_on:
minio:
condition: service_healthy
restart: "no"
environment:
<<: *minio-env
MINIO_BUCKET: *minio-dev-bucket
entrypoint: >
/bin/sh -c '
mc alias set local http://minio:9000 "$$MINIO_ROOT_USER" "$$MINIO_ROOT_PASSWORD" &&
mc mb --ignore-existing "local/$$MINIO_BUCKET"
'
app:
image: oven/bun:1.3.13
container_name: life-ustc-nextjs-dev
profiles: ["app"]
working_dir: /usr/src/app
env_file:
- .env
command: ["sh", "/usr/src/app/docker-entrypoint.dev.sh"]
environment:
<<: *minio-aws-env
NODE_ENV: development
APP_HOST: 0.0.0.0
PORT: 3000
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/life_ustc_dev
APP_PUBLIC_ORIGIN: http://127.0.0.1:3000
BETTER_AUTH_URL: http://127.0.0.1:3000
S3_BUCKET: *minio-dev-bucket
AWS_ENDPOINT_URL_S3: *minio-internal-endpoint
CHOKIDAR_USEPOLLING: "1"
ports:
- "127.0.0.1:3000:3000"
healthcheck:
test: ["CMD-SHELL", "bun run health"]
interval: 10s
timeout: 10s
retries: 12
start_period: 20s
volumes:
- ./:/usr/src/app:Z
- bun-cache:/home/bun/.bun/install/cache
depends_on:
postgres:
condition: service_healthy
minio:
condition: service_healthy
minio-setup:
condition: service_completed_successfully
volumes:
postgres-data-dev:
minio-data-dev:
bun-cache: