forked from Techiebutler/freeframe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
172 lines (164 loc) · 4.91 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
172 lines (164 loc) · 4.91 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
services:
postgres:
image: postgres:15-alpine
environment:
POSTGRES_USER: freeframe
POSTGRES_PASSWORD: freeframe
POSTGRES_DB: freeframe
ports:
- "5433:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U freeframe"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redisdata:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
minio:
image: minio/minio:RELEASE.2025-04-22T22-12-26Z
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
MINIO_CORS_ALLOW_ORIGIN: ${MINIO_CORS_ALLOW_ORIGIN:-http://localhost:3000}
MINIO_CORS_ALLOW_METHODS: GET,PUT,POST,DELETE,HEAD
MINIO_CORS_ALLOW_HEADERS: "*"
MINIO_CORS_EXPOSE_HEADERS: ETag,Content-Length,x-amz-request-id
ports:
- "9000:9000"
- "9001:9001"
volumes:
- miniodata:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 5s
timeout: 5s
retries: 5
minio-init:
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/freeframe;
mc anonymous set download local/freeframe;
exit 0;
"
api:
build:
context: .
dockerfile: apps/api/Dockerfile
ports:
- "8000:8000"
env_file:
- .env
environment:
DATABASE_URL: postgresql://freeframe:freeframe@postgres:5432/freeframe
REDIS_URL: redis://redis:6379/0
# Storage: "minio" for local MinIO (dev), "s3" for AWS S3 (prod)
S3_STORAGE: ${S3_STORAGE:-minio}
S3_ACCESS_KEY: ${S3_ACCESS_KEY:-minioadmin}
S3_SECRET_KEY: ${S3_SECRET_KEY:-minioadmin}
S3_ENDPOINT: http://minio:9000
S3_BUCKET: ${S3_BUCKET:-freeframe}
S3_REGION: ${S3_REGION:-us-east-1}
S3_PUBLIC_ENDPOINT: ${S3_PUBLIC_ENDPOINT:-http://localhost:9000}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
minio:
condition: service_healthy
volumes:
- ./apps/api:/workspace/apps/api
- ./packages/transcoder:/workspace/packages/transcoder
command: >
sh -c "cd /workspace/apps/api && alembic upgrade head && cd /workspace && uvicorn apps.api.main:app --host 0.0.0.0 --port 8000 --reload"
worker:
build:
context: .
dockerfile: apps/api/Dockerfile
env_file:
- .env
environment:
DATABASE_URL: postgresql://freeframe:freeframe@postgres:5432/freeframe
REDIS_URL: redis://redis:6379/0
S3_STORAGE: ${S3_STORAGE:-minio}
S3_ACCESS_KEY: ${S3_ACCESS_KEY:-minioadmin}
S3_SECRET_KEY: ${S3_SECRET_KEY:-minioadmin}
S3_ENDPOINT: http://minio:9000
S3_BUCKET: ${S3_BUCKET:-freeframe}
S3_REGION: ${S3_REGION:-us-east-1}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
minio:
condition: service_healthy
volumes:
- ./apps/api:/workspace/apps/api
- ./packages/transcoder:/workspace/packages/transcoder
command: celery -A apps.api.tasks.celery_app worker -Q transcoding -c ${TRANSCODING_CONCURRENCY:-2} --loglevel=info
email_worker:
build:
context: .
dockerfile: apps/api/Dockerfile
env_file:
- .env
environment:
DATABASE_URL: postgresql://freeframe:freeframe@postgres:5432/freeframe
REDIS_URL: redis://redis:6379/0
S3_STORAGE: ${S3_STORAGE:-minio}
S3_ACCESS_KEY: ${S3_ACCESS_KEY:-minioadmin}
S3_SECRET_KEY: ${S3_SECRET_KEY:-minioadmin}
S3_ENDPOINT: http://minio:9000
S3_BUCKET: ${S3_BUCKET:-freeframe}
S3_REGION: ${S3_REGION:-us-east-1}
depends_on:
redis:
condition: service_healthy
volumes:
- ./apps/api:/workspace/apps/api
- ./packages/transcoder:/workspace/packages/transcoder
command: celery -A apps.api.tasks.celery_app worker -Q email_high,email_low -c ${EMAIL_CONCURRENCY:-2} --loglevel=info
web:
image: node:20-alpine
working_dir: /app
ports:
- "3000:3000"
environment:
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://localhost:8000}
- NODE_ENV=development
- HOSTNAME=0.0.0.0
volumes:
- ./apps/web:/app
- web_node_modules:/app/node_modules
command: sh -c "npm install && npx next dev --hostname 0.0.0.0"
depends_on:
- api
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000"]
interval: 30s
timeout: 10s
retries: 10
start_period: 60s
volumes:
pgdata:
miniodata:
redisdata:
web_node_modules: