Skip to content

Commit f3d1dcd

Browse files
committed
setup minio for development automatically
1 parent 83aad03 commit f3d1dcd

File tree

2 files changed

+42
-4
lines changed

2 files changed

+42
-4
lines changed

docker-compose.override.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@ services:
3232
- DEBUG=true
3333
- SMTP_PORT=1025
3434
- SMTP_HOST=mailserver
35-
- AWS_ENDPOINT=http://minio:9000
36-
- S3_PUBLIC_GATEWAY=http://localhost:9000
35+
- AWS_ACCESS_KEY_ID=h6uWJf7Earij3143YBV7
36+
- AWS_SECRET_ACCESS_KEY=or9ZWh34BmAIqzIbJL5QpeTrey5ChGirH0mmyMdn
37+
- AWS_ENDPOINT=http:/minio:9000
38+
- AWS_REGION=local
39+
- AWS_BUCKET=ocelot
40+
- S3_PUBLIC_GATEWAY=http:/localhost:9000
3741
volumes:
3842
- ./backend:/app
3943

@@ -57,9 +61,24 @@ services:
5761
volumes:
5862
- minio_data:/data
5963
environment:
60-
- MINIO_ROOT_USER=AKIAIOSFODNN7EXAMPLE
61-
- MINIO_ROOT_PASSWORD=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
64+
- MINIO_ROOT_USER=h6uWJf7Earij3143YBV7
65+
- MINIO_ROOT_PASSWORD=or9ZWh34BmAIqzIbJL5QpeTrey5ChGirH0mmyMdn
6266
command: server /data --console-address ":9001"
6367

68+
minio-mc:
69+
image: quay.io/minio/mc
70+
depends_on:
71+
- minio
72+
restart: on-failure
73+
volumes:
74+
- ./minio/readonly-policy.json:/tmp/readonly-policy.json
75+
entrypoint: >
76+
/bin/sh -c "
77+
sleep 5;
78+
/usr/bin/mc alias set dockerminio http://minio:9000 h6uWJf7Earij3143YBV7 or9ZWh34BmAIqzIbJL5QpeTrey5ChGirH0mmyMdn;
79+
/usr/bin/mc mb --ignore-existing dockerminio/ocelot;
80+
/usr/bin/mc anonymous set-json /tmp/readonly-policy.json dockerminio/ocelot;
81+
"
82+
6483
volumes:
6584
minio_data:

minio/readonly-policy.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"Version": "2012-10-17",
3+
"Statement": [
4+
{
5+
"Effect": "Allow",
6+
"Principal": {
7+
"AWS": [
8+
"*"
9+
]
10+
},
11+
"Action": [
12+
"s3:GetObject"
13+
],
14+
"Resource": [
15+
"arn:aws:s3:::ocelot/*"
16+
]
17+
}
18+
]
19+
}

0 commit comments

Comments
 (0)