-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yaml
59 lines (55 loc) · 1.17 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
version: '3.7'
services:
postgres:
container_name: postgres
image: postgres:12.0
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=secret
ports:
- 5432:5432
# volumes:
# - ./postgres-data:/var/lib/postgresql/data
network_mode: "bridge"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
app:
container_name: app
build:
context: ./
dockerfile: Dockerfile
image: rest-api-demo
depends_on:
- postgres
ports:
- 8080:8080
environment:
API_DB_ADDRESS: 'postgres:5432'
network_mode: "bridge"
links:
- postgres
volumes:
- ./config/app.yaml:/opt/app/config/app.yaml
- ./scripts/migrations:/opt/app/scripts/migrations
command:
- /bin/bash
- -c
- |
sleep 10
ls -al
./migrate -dir /opt/app/scripts/migrations -init
./app
swagger:
container_name: swagger
image: swaggerapi/swagger-ui
environment:
- SWAGGER_JSON=/sw/swagger.json
volumes:
- ./swagger/:/sw/
ports:
- 8888:8080
links:
- app