-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
79 lines (77 loc) · 1.91 KB
/
docker-compose.yml
File metadata and controls
79 lines (77 loc) · 1.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
version: "3.8"
services:
####### From Docker Hub #######
# app:
# image: hatemjaber/image-resize-server:latest
# container_name: app
# hostname: app
# ports:
# - "0.0.0.0:5555:5555"
# env_file:
# - .env
# depends_on:
# - minio
####### From Local #######
app:
build:
context: .
dockerfile: Dockerfile.dev
image: image-resize-server
container_name: app
hostname: app
volumes:
- node_modules:/app/node_modules
- .:/app
working_dir: /app
ports:
- "0.0.0.0:5555:5555"
env_file:
- .env
depends_on:
- minio
minio:
image: minio/minio
container_name: minio
hostname: minio
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: ${BUCKET_ACCESS_KEY_ID}
MINIO_ROOT_PASSWORD: ${BUCKET_ACCESS_KEY}
volumes:
- minio_data:/data
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
createbuckets:
image: minio/mc
container_name: createbuckets
restart: no
depends_on:
- minio
profiles: ["setup"]
environment:
- MINIO_ROOT_USER=${BUCKET_ACCESS_KEY_ID}
- MINIO_ROOT_PASSWORD=${BUCKET_ACCESS_KEY}
entrypoint: >
/bin/sh -c "
until /usr/bin/mc config host add myminio http://minio:9000 ${BUCKET_ACCESS_KEY_ID} ${BUCKET_ACCESS_KEY}; do
echo 'Waiting for MinIO to be ready...'
sleep 1
done;
if ! /usr/bin/mc ls myminio/${BUCKET_NAME} > /dev/null 2>&1; then
echo 'Bucket does not exist, creating it...'
/usr/bin/mc mb myminio/${BUCKET_NAME};
/usr/bin/mc anonymous set download myminio/${BUCKET_NAME};
else
echo 'Bucket already exists'
fi;
exit 0;
"
volumes:
minio_data:
node_modules: