-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add initial version of compose * Enable volume for pre-init scripts * Make storage persistent for dev env * Provide healthcheck and deeper infra configuration * Fix HC user and DB * Finetune DB cluster settings * Supply pgadmin service * Fix pg_stat_statements not being available * Update docs
- Loading branch information
1 parent
452ae39
commit 3f1482f
Showing
3 changed files
with
88 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
version: "3.8" | ||
services: | ||
|
||
postgres: | ||
image: postgres:14.10-alpine3.19 | ||
container_name: crack-db | ||
command: | ||
- "postgres" | ||
- "-c" | ||
- "max_connections=50" | ||
- "-c" | ||
- "shared_preload_libraries=pg_stat_statements" | ||
- "-c" | ||
- "pg_stat_statements.max=10000" | ||
- "-c" | ||
- "pg_stat_statements.track=all" | ||
environment: | ||
POSTGRES_DB: "crack" | ||
POSTGRES_USER: "crack_user" | ||
POSTGRES_PASSWORD: "crack_pass" | ||
PGDATA: "/var/lib/postgresql/data/pgdata" | ||
volumes: | ||
- ./rearguarde/configuration/init_scripts:/docker-entrypoint-initdb.d | ||
- local_crack_storage:/var/lib/postgresql/data | ||
ports: | ||
- "5432:5432" | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -U crack_user -d crack"] | ||
interval: 15s | ||
timeout: 5s | ||
retries: 5 | ||
start_period: 10s | ||
restart: on-failure:2 | ||
deploy: | ||
resources: | ||
limits: | ||
cpus: '1' | ||
memory: 2G | ||
networks: | ||
- main | ||
|
||
pgadmin: | ||
image: dpage/pgadmin4:8.1 | ||
container_name: crack-admin-dash | ||
environment: | ||
PGADMIN_DEFAULT_EMAIL: "admin@example.com" | ||
PGADMIN_DEFAULT_PASSWORD: "crack_admin_pass" | ||
PGADMIN_CONFIG_SERVER_MODE: "False" | ||
volumes: | ||
- local_pgadmin_storage:/var/lib/pgadmin | ||
ports: | ||
- "5433:80" | ||
restart: unless-stopped | ||
deploy: | ||
resources: | ||
limits: | ||
cpus: '0.5' | ||
memory: 1G | ||
networks: | ||
- main | ||
|
||
volumes: | ||
local_crack_storage: | ||
local_pgadmin_storage: | ||
|
||
networks: | ||
main: | ||
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
create extension if not exists pg_stat_statements; |