-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
125 lines (118 loc) · 3.55 KB
/
docker-compose.dev.yml
File metadata and controls
125 lines (118 loc) · 3.55 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
# Dev stack: Postgres, API, Web (Vite + Better Auth in same process).
# From registry/: docker compose -f docker-compose.dev.yml up (or: just dev-docker)
# With just: cd registry && just dev runs API+web on host with .env loaded.
# API: http://localhost:8080 Web: http://localhost:3000 (serves app + /auth)
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: registry
POSTGRES_PASSWORD: registry
POSTGRES_DB: devsper_registry
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U registry -d devsper_registry"]
interval: 5s
timeout: 5s
retries: 5
mailhog:
image: mailhog/mailhog:latest
ports:
- "1025:1025" # SMTP
- "8025:8025" # Web UI
minio:
image: minio/minio:latest
command: server /data --console-address ":9001"
ports:
- "9000:9000" # S3 API
- "9001:9001" # MinIO Console
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
volumes:
- minio-data:/data
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 5s
timeout: 5s
retries: 5
createbuckets:
image: minio/mc:latest
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set local http://minio:9000 minioadmin minioadmin;
mc mb --ignore-existing local/devsper-registry-dev;
mc anonymous set download local/devsper-registry-dev;
echo 'Bucket created.';
"
api:
build:
context: api
dockerfile: Dockerfile.dev
ports:
- "8080:8080"
environment:
DATABASE_URL: postgresql://registry:registry@postgres:5432/devsper_registry?sslmode=disable
JWKS_URL: http://web:3000/auth/jwks
INTERNAL_SECRET: ${INTERNAL_SECRET:-dev-internal-secret}
PORT: "8080"
BASE_URL: http://localhost:8080
RATE_LIMIT_RPS: "100"
MAX_UPLOAD_SIZE_MB: "100"
VERIFICATION_WORKERS: "2"
SMTP_HOST: mailhog
SMTP_PORT: "1025"
SMTP_FROM: noreply@registry.local
S3_ENDPOINT: http://minio:9000
S3_PUBLIC_ENDPOINT: http://localhost:9000
S3_BUCKET: devsper-registry-dev
S3_REGION: us-east-1
AWS_ACCESS_KEY_ID: minioadmin
AWS_SECRET_ACCESS_KEY: minioadmin
volumes:
- ./api:/app
- api-tmp:/app/tmp
depends_on:
postgres:
condition: service_healthy
mailhog:
condition: service_started
minio:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-q", "-O", "-", "http://localhost:8080/health"]
interval: 3s
timeout: 2s
retries: 10
start_period: 15s
web:
image: oven/bun:1-alpine
working_dir: /app
command: sh -c "bun install && bun run dev"
ports:
- "3000:3000"
environment:
DATABASE_URL: postgresql://registry:registry@postgres:5432/devsper_registry?sslmode=disable
GO_API_INTERNAL_URL: http://api:8080
INTERNAL_SECRET: ${INTERNAL_SECRET:-dev-internal-secret}
FRONTEND_URL: http://localhost:3000
GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID:-}
GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET:-}
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET:-}
VITE_PROXY_TARGET: http://api:8080
VITE_API_BASE_URL: ""
VITE_REGISTRY_URL: http://localhost:3000/simple/
VITE_GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
volumes:
- ./web:/app
depends_on:
api:
condition: service_healthy
volumes:
api-tmp:
minio-data: