-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
45 lines (42 loc) · 1.08 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
version: '3.5'
services:
go-service-example:
build: .
hostname: go-service-example.svc
container_name: go-service-example.svc
volumes:
- .:/usr/src/go-service-example
working_dir: /usr/src/go-service-example
environment:
API_HOST: go-service-example
API_PORT: ${API_PORT}
POSTGRES_HOST: postgresdb
POSTGRES_PORT: ${POSTGRES_PORT}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
command: bash -c "go run cmd/go-service-example/main.go"
ports:
- "${API_PORT}:${API_PORT}"
depends_on:
- postgresdb
links:
- postgresdb
networks:
example-network:
postgresdb:
image: postgres:13
hostname: postgres.svc
container_name: postgres.svc
restart: always
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
ports:
- "${POSTGRES_PORT}:${POSTGRES_PORT}"
networks:
example-network:
networks:
example-network:
driver: bridge