Last active
April 3, 2023 11:06
-
-
Save koungkub/fd7cadb8c1bbc3453a0c3c977b8a5137 to your computer and use it in GitHub Desktop.
Create postgresql instance through docker-compose
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
version: '3.7' | |
services: | |
pg: | |
image: postgres:15-bullseye | |
restart: always | |
networks: | |
- internal | |
shm_size: 256mb | |
healthcheck: | |
test: [ 'CMD', 'pg_isready', '-U', 'postgres' ] | |
ports: | |
- 5432:5432 | |
volumes: | |
- ./pg-data:/var/lib/postgresql/data | |
environment: | |
- POSTGRES_USER=postgres | |
- POSTGRES_PASSWORD=root | |
- POSTGRES_DB=postgres | |
command: | | |
postgres | |
-c shared_preload_libraries=pg_stat_statements | |
-c pg_stat_statements.track=all | |
-c max_connections=200 | |
-c shared_buffers=256MB | |
-c effective_cache_size=8GB | |
-c work_mem=16MB | |
-c maintenance_work_mem=128MB | |
-c min_wal_size=128MB | |
-c max_wal_size=2GB | |
-c checkpoint_completion_target=0.9 | |
-c wal_buffers=16MB | |
-c default_statistics_target=100 | |
pgadmin: | |
image: dpage/pgadmin4:6 | |
restart: always | |
networks: | |
- internal | |
ports: | |
- 8080:80 | |
- 18080:443 | |
environment: | |
- [email protected] | |
- PGADMIN_DEFAULT_PASSWORD=root | |
networks: | |
internal: | |
driver: bridge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment