-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
54 lines (52 loc) · 1.25 KB
/
docker-compose.yml
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
version: "3"
services:
db:
container_name: api_db
image: postgres:15
volumes:
- ./init:/docker-entrypoint-initdb.d
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
tty: true
networks: [restaurant-network]
ports:
- 5432:5432
api:
container_name: api
image: golang:1.20.4-bullseye
volumes:
- ./project:/project/
working_dir: /project
ports:
- 8080:8080
# ホットリロード
# command: /bin/bash -c "go get -u github.com/cosmtrek/air && go build -o /go/bin/air github.com/cosmtrek/air && air -c .air.toml"
# これでもいい
# command: /bin/bash -c "go mod tidy && go run main.go"
# command: >
# /bin/bash -c "
# go mod tidy &&
# go run main.go
# "
tty: true
networks: [restaurant-network]
environment:
- HOST_IP=${HOST_IP}
depends_on:
- db
frontend-react-app:
container_name: frontend-react-app
image: node:lts-alpine
working_dir: /app
volumes:
- ./frontend-react-app:/app
command: sh -c "npm run dev"
tty: true
ports:
- 3000:5173
environment:
- VITE_HOST_IP=${HOST_IP}
networks:
restaurant-network:
driver: bridge