-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
72 lines (68 loc) · 1.54 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
version: '3.7'
services:
golang-app:
env_file: .env
container_name: ${GOLANG_CONTAINER_NAME}
build:
context: .
dockerfile: Dockerfile
args:
ENV: "${ENV}"
ports:
- '${GOLANG_APP_PORT}:8080'
networks:
- communication-network
depends_on:
- postgres
- redis
volumes:
- ./:/golangApp
redis:
image: redis:alpine
container_name: ${REDIS_CONTAINER_NAME}
command: redis-server --appendonly yes --replica-read-only no
volumes:
- ./:/redis
ports:
- ${REDIS_PORT}:6379
networks:
- communication-network
healthcheck:
test: redis-cli -h redis -p 6379 ping
start_period: 3s
interval: 2s
timeout: 2s
retries: 10
migration:
image: migrate/migrate
command:
[
"-path",
"/migrations",
"-database",
"postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=disable",
"up"
]
volumes:
- ./migrations:/migrations
networks:
- communication-network
depends_on:
- postgres
postgres:
image: postgres:alpine
container_name: ${POSTGRES_CONTAINER_NAME}
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- "./:/var/lib/data"
ports:
- '${POSTGRES_PORT}:5432'
networks:
- communication-network
networks:
communication-network:
name: ${COMMUNICATION_NETWORK_NAME}
external: true