-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.ci.yml
75 lines (70 loc) · 1.61 KB
/
docker-compose.ci.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
version: '3.0'
services:
db:
container_name: pg01
build:
context: .
dockerfile: build/db/Dockerfile
environment:
POSTGRES_HOST: ${POSTGRES_HOST}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- local_postgres_data:/var/lib/postgresql/data
ports:
- "${POSTGRES_PORT}:${POSTGRES_PORT}"
networks:
- golangnetwork
healthcheck:
test: ["CMD-SHELL", "pg_isready -q -d ${POSTGRES_DB} -U ${POSTGRES_USER} || exit 1"]
interval: 10s
timeout: 5s
retries: 3
start_period: 20s
deploy:
resources:
limits:
cpus: '0.4'
memory: '0.4GB'
migrate:
image: migrate/migrate
container_name: mg01
volumes:
- ./migrations:/migrations
command: ["-path", "/migrations", "-database", "${POSTGRES_URL}" , "up"]
depends_on:
db:
condition: service_healthy
networks:
- golangnetwork
api:
build:
context: .
dockerfile: build/api/Dockerfile
image: app
container_name: go01
restart: unless-stopped
environment:
- PORT=${PORT}
- GIN_MODE=${GIN_MODE}
- LOG_LEVEL=${LOG_LEVEL}
- LOG_OUTPUT=${LOG_OUTPUT}
- AUTHORIZATION_URL=${AUTHORIZATION_URL}
- POSTGRES_URL=${POSTGRES_URL}
ports:
- "${PORT}:${PORT}"
depends_on:
- db
- migrate
networks:
- golangnetwork
deploy:
resources:
limits:
cpus: '0.2'
memory: '0.2GB'
volumes:
local_postgres_data: {}
networks:
golangnetwork: