-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
·88 lines (78 loc) · 2.23 KB
/
docker-compose.yml
File metadata and controls
executable file
·88 lines (78 loc) · 2.23 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
80
81
82
83
84
85
86
87
version: "3.9"
services:
fastapi:
container_name: backend-livinglab
build:
context: ./APIs
dockerfile : Dockerfile
working_dir: /code/app
command: uvicorn main:app --host 0.0.0.0 --port 8000 --reload
ports:
- 8000:8000 #HOST_PORT:CONTAINER_PORT -> Networked service-to-service는 CONTAINER_PORT를 사용한다.
volumes:
- /home/data/LivingLab/backend/Sample_images:/code/app/Sample_images
- /home/data/LivingLab/backend/Uploaded_images:/code/app/Uploaded_images
- /home/data/LivingLab/backend/ML:/code/app/ML/outside
- ./APIs:/code/app
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
networks:
- appnet
nginx:
image: nginx:latest
container_name: reverse-proxy-livinglab
ports:
- 80:80 # 컨테이너의 80 포트를 호스트의 80 포트로 노출
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro # nginx 설정 파일 연결
depends_on:
- fastapi # fastapi가 먼저 실행되어야 함
- frontend
networks:
- appnet
frontend:
build:
context: ./frontend
dockerfile : Dockerfile
container_name: frontend-livinglab
ports:
- 3000:3000
working_dir: /code/living-front
volumes:
- ./frontend:/code
networks:
- appnet
environment:
- WDS_SOKET_PORT=0
db:
# We use a mariadb image which supports both amd64 & arm64 architecture
#image: mariadb:10.6.4-focal
# If you really want to use MySQL, uncomment the following line
image: mysql:8.0.19
container_name: livinglab-db
networks:
- appnet
command: --init-file /db-data/init.sql
environment:
- MYSQL_DATABASE=plantLab
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db-password
secrets:
- db-password
restart: always
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "--silent"]
interval: 3s
retries: 5
start_period: 30s
volumes:
- /home/data/LivingLab/db/init.sql:/db-data/init.sql
- /home/data/LivingLab/db:/db-data
networks:
appnet:
driver: bridge
secrets:
db-password:
file: /home/data/LivingLab/db/password.txt