-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
41 lines (39 loc) · 1.02 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
version: "3.8"
services:
db:
image: postgres
container_name: pg_ctnr
environment:
POSTGRES_PASSWORD: sampleapi
POSTGRES_USER: sampleapi
POSTGRES_DB: sampleapi
volumes:
- ./init_database.sql:/docker-entrypoint-initdb.d/script.sql
ports:
- "15432:5432"
restart: always
networks:
- pg-network
app:
image: golang
container_name: golang_ctnr
restart: always
environment:
POSTGRES_PASSWORD: sampleapi
POSTGRES_USER: sampleapi
POSTGRES_DB: sampleapi
PG_HOST: pg_ctnr
PG_PORT: 5432
volumes:
- .:/go/src/github.com/lrweck/go-sampleapi
working_dir: /go/src/github.com/lrweck/go-sampleapi
command: go run .
ports:
- "8001:8000"
depends_on:
- db
networks:
- pg-network
networks:
pg-network:
driver: bridge