-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yml
48 lines (48 loc) · 1.27 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
version: "3.5"
services:
example-golang-api-service:
container_name: "example-golang-api"
image: "ruyjfs/go"
build: docker/.
working_dir: /app
volumes:
- .:/app
env_file: ./docker/docker.env
entrypoint: ["sh", "./docker/entrypoint.sh"]
command: sh -c 'gin --port=8080'
ports:
- "8085:8080"
restart: always
tty: true
links:
- example-golang-db-service
depends_on:
- example-golang-db-service
example-golang-db-service:
container_name: example-golang-db
image: postgres:alpine
env_file: ./docker/docker.env
volumes:
- ./docker/database/postgres/data:/var/lib/postgresql/data
- ./docker/database/postgres/scripts:/docker-entrypoint-initdb.d
ports:
- "5435:5432"
tty: true
restart: always
healthcheck:
#IMPORTANT! change this if you have changed a local.env
test: ["CMD-SHELL", "pg_isready -U example-golang-usr -d example-golang-db"]
interval: 10s
timeout: 5s
retries: 5
example-golang-adminer-service:
container_name: example-golang-adminer
image: adminer
restart: always
ports:
- 8086:8080
env_file: ./docker/docker.env
links:
- example-golang-db-service
depends_on:
- example-golang-db-service