-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-s3.yml
74 lines (69 loc) · 1.64 KB
/
docker-compose-s3.yml
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
version: "3"
services:
app:
build:
context: .
image: api
ports:
- "8000:8000"
volumes:
- ./app:/app
command: >
sh -c "python manage.py wait_for_db &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
environment:
- DB_HOST=db
- DB_NAME=api
- DB_USER=postgres
- DB_PASS=supersecretpassword
- GET_DB_SECRET=0
- DEBUG=1
- S3_STORAGE_BACKEND=1
- S3_STORAGE_BUCKET_NAME=static
- MINIO_STORAGE_BACKEND=1
- MINIO_ACCESS_KEY_ID=user
- MINIO_SECRET_ACCESS_KEY=password
- MINIO_API=http://172.17.0.1:9000
depends_on:
createbucket:
condition: service_started
db:
condition: service_healthy
minio:
condition: service_started
createbucket:
image: minio/mc:latest
depends_on:
- minio
entrypoint: >
/bin/sh -c "
/usr/bin/mc config host add --api s3v4 s3 http://minio:9000 user password;
/usr/bin/mc mb s3/static/;
/usr/bin/mc anonymous set download s3/static;
"
db:
image: postgres:12-alpine
environment:
- POSTGRES_DB=api
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=supersecretpassword
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
minio:
image: minio/minio:latest
container_name: minio
ports:
- "9000:9000"
- "9001:9001"
volumes:
- data:/data
environment:
- "MINIO_ROOT_USER=user"
- "MINIO_ROOT_PASSWORD=password"
command: server /data --console-address :9001
volumes:
data: