-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpodman-compose.yml
More file actions
151 lines (148 loc) · 3.98 KB
/
Copy pathpodman-compose.yml
File metadata and controls
151 lines (148 loc) · 3.98 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
services:
crypto-scout-collector-db:
image: timescale/timescaledb:latest-pg17
container_name: crypto-scout-collector-db
cpus: "1.0"
mem_limit: "256m"
mem_reservation: "128m"
shm_size: "1g"
ulimits:
nofile:
soft: 262144
hard: 262144
volumes:
- ./data/postgresql:/var/lib/postgresql/data
- ./script/init.sql:/docker-entrypoint-initdb.d/00-init.sql:ro
- ./script/bybit_spot_tables.sql:/docker-entrypoint-initdb.d/01_bybit_spot_tables.sql:ro
- ./script/bybit_linear_tables.sql:/docker-entrypoint-initdb.d/02_bybit_linear_tables.sql:ro
- ./script/crypto_scout_tables.sql:/docker-entrypoint-initdb.d/03_crypto_scout_tables.sql:ro
- ./script/btc_usd_daily_inserts.sql:/docker-entrypoint-initdb.d/04_btc_usd_daily_inserts.sql:ro
- ./script/btc_usd_weekly_inserts.sql:/docker-entrypoint-initdb.d/05_btc_usd_weekly_inserts.sql:ro
- ./script/cmc_fgi_inserts.sql:/docker-entrypoint-initdb.d/06_cmc_fgi_inserts.sql:ro
- ./script/alternative_fgi_inserts.sql:/docker-entrypoint-initdb.d/07_alternative_fgi_inserts.sql:ro
networks:
- crypto-scout-bridge
env_file:
- ./secret/timescaledb.env
environment:
TZ: UTC
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
command:
- postgres
- -c
- shared_preload_libraries=timescaledb,pg_stat_statements
- -c
- max_connections=200
- -c
- shared_buffers=2GB
- -c
- effective_cache_size=6GB
- -c
- maintenance_work_mem=1GB
- -c
- work_mem=16MB
- -c
- autovacuum_work_mem=256MB
- -c
- wal_level=replica
- -c
- max_wal_size=8GB
- -c
- min_wal_size=2GB
- -c
- checkpoint_timeout=15min
- -c
- checkpoint_completion_target=0.9
- -c
- wal_compression=on
- -c
- timezone=UTC
- -c
- log_min_duration_statement=500ms
- -c
- log_checkpoints=on
- -c
- timescaledb.telemetry_level=off
- -c
- pg_stat_statements.track=all
- -c
- pg_stat_statements.max=10000
- -c
- timescaledb.max_background_workers=96
- -c
- max_worker_processes=192
- -c
- track_io_timing=on
- -c
- track_functions=pl
restart: unless-stopped
stop_grace_period: 1m
crypto-scout-collector-backup:
image: prodrigestivill/postgres-backup-local:latest
container_name: crypto-scout-collector-db-backups
cpus: "0.5"
mem_limit: "256m"
mem_reservation: "128m"
restart: unless-stopped
env_file:
- ./secret/postgres-backup.env
environment:
TZ: UTC
volumes:
- ./backups:/backups
depends_on:
- crypto-scout-collector-db
networks:
- crypto-scout-bridge
crypto-scout-collector:
build:
context: .
dockerfile: Dockerfile
image: crypto-scout-collector:0.0.1
container_name: crypto-scout-collector
cpus: "0.5"
mem_limit: "512m"
mem_reservation: "256m"
env_file:
- ./secret/collector.env
environment:
TZ: UTC
networks:
- crypto-scout-bridge
depends_on:
crypto-scout-collector-db:
condition: service_healthy
crypto-scout-collector-backup:
condition: service_started
security_opt:
- no-new-privileges=true
read_only: true
tmpfs:
- /tmp:rw,size=64m,mode=1777,nodev,nosuid
cap_drop:
- ALL
user: "10001:10001"
init: true
pids_limit: 256
ulimits:
nofile:
soft: 4096
hard: 4096
restart: unless-stopped
stop_signal: SIGTERM
stop_grace_period: 30s
healthcheck:
test: [ "CMD-SHELL", "curl -f http://localhost:8081/health || exit 1" ]
interval: 10s
timeout: 3s
retries: 5
start_period: 30s
networks:
crypto-scout-bridge:
name: crypto-scout-bridge
external: true