-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yaml
72 lines (67 loc) · 2.48 KB
/
compose.yaml
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
name: "saritasa-s3-tools"
volumes:
minio_data:
services:
# ###########################################################################
# MinIO Storage
# minio:9001 - Server
# minio:9000 - UI
# We preferred to choose `Minio` instead of `Localstack` due to the fact
# that `localstack` does not support saving files after restarting the docker
# container for the free version.
# https://github.com/localstack/localstack/issues/6281#issuecomment-1169731265
# ###########################################################################
minio:
image: minio/minio:latest
command: server --address 0.0.0.0:9001 --console-address 0.0.0.0:9000 /data
environment:
- MINIO_ROOT_USER=root
- MINIO_ROOT_PASSWORD=rootroot
# Set `MINIO_DOMAIN` to enable virtual-hosted-style for minio.
# https://min.io/docs/minio/linux/administration/object-management.html#id1
- MINIO_DOMAIN=s3.minio.localhost
ports:
- "9001:9001"
- "9000:9000"
volumes:
- minio_data:/data
networks:
default:
aliases:
# Set alias that suitable for virtual-hosted-style URL structure:
# `https://<bucket>.s3.<region>.amazonaws.com/<key>
# We need apply this style for local S3 storage because path-style
# URLs will be discontinued in the future, and we want to make
# consistent URLs for uploading and downloading files.
# https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html
- ${COMPOSE_PROJECT_NAME}-files.s3.minio.localhost
# ###########################################################################
# Service for creating bucket in minio service
# ###########################################################################
minio-create-bucket:
image: minio/mc:latest
depends_on:
- minio
entrypoint: >
/bin/sh -c "
/usr/bin/mc alias set s3minio http://minio:9001 root rootroot;
/usr/bin/mc mb s3minio/${COMPOSE_PROJECT_NAME}-files;
/usr/bin/mc anonymous set public s3minio/${COMPOSE_PROJECT_NAME}-files;
exit 0;
"
postgres:
image: postgres:16
ports:
- "5432:5432"
healthcheck:
test: [
"CMD-SHELL",
"pg_isready -h postgres -t 5 -U ${COMPOSE_PROJECT_NAME} || false"
]
interval: 1s
timeout: 5s
retries: 10
environment:
- POSTGRES_DB=${COMPOSE_PROJECT_NAME}
- POSTGRES_USER=${COMPOSE_PROJECT_NAME}
- POSTGRES_PASSWORD=postgres