-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
40 lines (38 loc) · 1.01 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
version: '3.4'
services:
api:
build: ./bee_build
image: ${SERVICE_NAME}
container_name: ${SERVICE_NAME}
volumes:
- gosrc:/go
- .:/go/src/${API_BASE_DIR}/${API_NAME}
env_file:
- custom.env
- .env
ports:
- "${API_PORT}:${API_PORT}"
command: sh -c 'cd ${API_BASE_DIR}/${API_NAME};go get -v ./...; bee migrate -driver=postgres -conn="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}/${POSTGRES_DB}?sslmode=disable&search_path=public" || true; bee run -downdoc=true -gendoc=true'
depends_on:
- db
networks:
- back_end
db:
container_name: ${POSTGRES_HOST}
image: postgres:10
ports:
- "${POSTGRES_PORT}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
networks:
- back_end
volumes:
gosrc:
postgres_data:
networks:
back_end:
external: true