-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
75 lines (69 loc) · 1.54 KB
/
docker-compose.yml
File metadata and controls
75 lines (69 loc) · 1.54 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
name: imagehost
version: '3.8'
services:
mysql:
image: mysql:8.0
container_name: imagehost-mysql
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=root_pass
- MYSQL_DATABASE=image_host
- MYSQL_USER=imagehost
- MYSQL_PASSWORD=imagehost_pass
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-proot_pass"]
interval: 10s
timeout: 5s
retries: 10
networks:
- appnet
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: imagehost-backend
user: "root"
restart: unless-stopped
environment:
- PORT=8080
- DB_HOST=mysql
- DB_PORT=3306
- DB_USER=imagehost
- DB_PASSWORD=imagehost_pass
- DB_NAME=image_host
- UPLOAD_PATH=/data/uploads
- ALLOWED_TYPES=image/jpeg,image/png,image/gif,image/webp
volumes:
- uploads_data:/data/uploads
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 10s
timeout: 5s
retries: 12
start_period: 20s
depends_on:
mysql:
condition: service_healthy
networks:
- appnet
web:
build:
context: .
dockerfile: nginx/Dockerfile
container_name: imagehost-web
restart: unless-stopped
ports:
- "8080:80"
depends_on:
backend:
condition: service_healthy
networks:
- appnet
volumes:
mysql_data:
uploads_data:
networks:
appnet:
driver: bridge