-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.debug.yml
124 lines (122 loc) · 2.8 KB
/
docker-compose.debug.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
version: "3.9"
volumes:
postgres_data:
services:
postgres:
container_name: ucrm-go-db
image: postgres:11.13-alpine
command:
- "postgres"
- "-c"
- "max_connections=50"
- "-c"
- "shared_buffers=1GB"
- "-c"
- "effective_cache_size=4GB"
- "-c"
- "work_mem=16MB"
- "-c"
- "maintenance_work_mem=512MB"
- "-c"
- "random_page_cost=1.1"
- "-c"
- "temp_file_limit=10GB"
- "-c"
- "log_min_duration_statement=200ms"
- "-c"
- "idle_in_transaction_session_timeout=10s"
- "-c"
- "lock_timeout=1s"
- "-c"
- "statement_timeout=60s"
- "-c"
- "shared_preload_libraries=pg_stat_statements"
- "-c"
- "pg_stat_statements.max=10000"
- "-c"
- "pg_stat_statements.track=all"
environment:
POSTGRES_DB: ${DATABASE_NAME:-ucrm-db}
POSTGRES_USER: ${DATABASE_USER:-user}
POSTGRES_PASSWORD: ${DATABASE_PASS:-pass}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./migrations:/docker-entrypoint-initdb.d
ports:
- "5432:5432"
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${DATABASE_USER:-user} -d ${DATABASE_NAME:-ucrm-db}",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
deploy:
resources:
limits:
cpus: "1"
memory: 4G
networks:
ucrm:
ipv4_address: ${NETWORK_PREFIX:-172.4}.4.3
aliases:
- ucrm.db.loc
rabbitmq:
container_name: ucrm-go-rabbitmq
build:
context: ./
dockerfile: ./docker/rabbitmq.Dockerfile
image: rabbitmq:docker
environment:
- "RABBITMQ_USER=${RABBITMQ_USER:-guest}"
- "RABBITMQ_PASS=${RABBITMQ_PASSWORD:-guest}"
ports:
- 1883:1883
- 5672:5672
- 15672:15672
networks:
ucrm:
ipv4_address: ${NETWORK_PREFIX:-172.4}.4.20
aliases:
- ucrm.rabbitmq.loc
app:
depends_on:
- postgres
- rabbitmq
build:
context: ./
dockerfile: docker/app.debug.Dockerfile
env_file:
- .env
image: app:docker
security_opt:
- seccomp:unconfined
cap_add:
- SYS_PTRACE
ports:
- 8081:8081
- 2345:2345
entrypoint:
['/dlv', '--listen=:2345', '--headless=true', '--api-version=2', '--accept-multiclient', 'exec', '/usr/local/bin/app/main']
deploy:
resources:
limits:
cpus: "0.5"
memory: "100M"
reservations:
cpus: "0.25"
memory: 30M
networks:
ucrm:
ipv4_address: ${NETWORK_PREFIX:-172.4}.4.10
aliases:
- ucrm.api.loc
networks:
ucrm:
name: ucrm
ipam:
config:
- subnet: "${NETWORK_PREFIX:-172.4}.4.0/24"