-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
100 lines (96 loc) · 2.71 KB
/
docker-compose.yml
File metadata and controls
100 lines (96 loc) · 2.71 KB
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
# yaml-language-server: $schema=https://raw.githubusercontent.com/compose-spec/compose-go/master/schema/compose-spec.json
services:
prometheus_postgres:
image: postgres:16-alpine
container_name: prometheus_postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- postgres_database:/var/lib/postgresql/data
- ./docker/postgresql.conf:/etc/postgresql/postgresql.conf:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB} || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
command: postgres -c config_file=/etc/postgresql/postgresql.conf
networks:
- internal
deploy:
resources:
limits:
memory: 1024M
ports:
- "5432:5432"
prometheus_redis:
image: redis:8-alpine
container_name: prometheus_redis
restart: unless-stopped
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD}
volumes:
- redis_database:/data
- ./docker/redis.conf:/usr/local/etc/redis/redis.conf:ro
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
command: redis-server /usr/local/etc/redis/redis.conf --requirepass ${REDIS_PASSWORD}
networks:
- internal
deploy:
resources:
limits:
memory: 1024M
ports:
- "6379:6379"
prometheus_application:
profiles: ["application"]
container_name: prometheus_application
restart: unless-stopped
environment:
MIX_ENV: ${PHX_SERVER:-prod}
PHX_SERVER: ${PHX_SERVER:-true}
PHX_PORT: ${PHX_PORT:-4000}
SECRET_KEY_BASE: ${SECRET_KEY_BASE}
JWT_SECRET_KEY: ${JWT_SECRET_KEY}
POSTGRES_HOST: prometheus_postgres
POSTGRES_PORT: 5432
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_POOL_SIZE: ${POSTGRES_POOL_SIZE:-8}
REDIS_HOST: prometheus_redis
REDIS_PORT: 6379
REDIS_PASSWORD: ${REDIS_PASSWORD}
REDIS_POOL_SIZE: ${REDIS_POOL_SIZE:-8}
build:
context: .
dockerfile: Dockerfile
depends_on:
prometheus_postgres:
condition: service_healthy
prometheus_redis:
condition: service_healthy
networks:
- internal
deploy:
resources:
limits:
memory: 256M
ports:
- "${PHX_PORT:-4000}:${PHX_PORT:-4000}"
volumes:
postgres_database:
name: postgres_database
redis_database:
name: redis_database
networks:
internal:
driver: bridge