-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
69 lines (67 loc) · 1.63 KB
/
docker-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
version: "3.8"
services:
db:
image: postgres:15.2
ports:
- "5430:5432"
environment:
POSTGRES_PASSWORD: &postgres_password "docker1"
POSTGRES_USER: &postgres_user "docker"
POSTGRES_DB: &db_name "postgres"
volumes:
- ./database:/usr/src/app/database
- "dbdata:/var/lib/postgresql/data"
flyway:
image: flyway/flyway
command: -configFiles=/flyway/conf/flyway.conf info
volumes:
- ./flyway.conf:/flyway/conf/flyway.conf
- ./database/migrations:/flyway/sql
depends_on:
- db
app: &app
build:
context: .
dockerfile: Dockerfile
target: dev
working_dir: /usr/src/app/
volumes:
- .:/usr/src/app
- gomod-cache:/go/pkg/mod
- gobuild-cache:/.cache/go-build
entrypoint: "bash -c"
backend:
<<: *app
image: "patient_server"
environment:
DB_HOST: cloud-sql-proxy
DB_PORT: 5432
DB_USER: ${postgres_user}
DB_PASSWORD: ${postgres_password}
DB_NAME: ${db_name}
links:
- db
- cloud-sql-proxy
restart: always
working_dir: /usr/src/app/backend
ports:
- "8080:8080"
entrypoint: "nodemon --ext go,yaml --signal SIGTERM --exec go run cmd/main.go"
frontend:
<<: *app
links:
- backend
restart: always
working_dir: /usr/src/app/frontend
ports:
- "3000:3000"
entrypoint: "yarn dev"
cloud-sql-proxy:
image: gcr.io/cloudsql-docker/gce-proxy:1.27.0
command: /cloud_sql_proxy -instances=relu-backend:europe-west1:relu-sql-db=tcp:5432
ports:
- "5432:5432"
volumes:
dbdata: {}
gomod-cache: {}
gobuild-cache: {}