-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
75 lines (70 loc) · 1.75 KB
/
Copy pathdocker-compose.yml
File metadata and controls
75 lines (70 loc) · 1.75 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
services:
# Postgres: Our metadata database
db:
image: postgres:15-alpine
container_name: codedrop_db
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: codedrop
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
# Redis: High-speed counter/cache
redis:
image: redis:7-alpine
container_name: codedrop_redis
ports:
- "6379:6379"
# MinIO: A local replacement for AWS S3
minio:
image: minio/minio
container_name: codedrop_minio
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
command: server /data --console-address ":9001"
volumes:
- minio_data:/data
# Local dev server (optional - you can also run `go run cmd/server/main.go` directly)
server:
build: .
container_name: codedrop_server
ports:
- "8080:8080"
environment:
- DB_HOST=db
- DB_PORT=5432
- DB_USER=user
- DB_PASSWORD=password
- DB_NAME=codedrop
- DB_SSLMODE=disable
- REDIS_HOST=redis
- REDIS_PORT=6379
- S3_ENDPOINT=http://minio:9000
- S3_BUCKET=codedrop-bucket
- AWS_ACCESS_KEY_ID=minioadmin
- AWS_SECRET_ACCESS_KEY=minioadmin
depends_on:
- db
- redis
- createbuckets
# Create default bucket in MinIO automatically
createbuckets:
image: minio/mc
depends_on:
- minio
entrypoint: >
/bin/sh -c "
/usr/bin/mc alias set myminio http://minio:9000 minioadmin minioadmin;
/usr/bin/mc mb myminio/codedrop-bucket;
/usr/bin/mc anonymous set public myminio/codedrop-bucket;
exit 0;
"
volumes:
postgres_data:
minio_data: