Last active
March 6, 2023 07:21
-
-
Save huksley/db3ea8f2b535c13932e1b735c5f5d5e7 to your computer and use it in GitHub Desktop.
Run postgres and redis in a single shell command
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
# Postgres minimal config | |
port = 5432 | |
listen_addresses = 'localhost' | |
max_connections = 100 | |
shared_buffers = 32MB | |
huge_pages = off | |
temp_buffers = 8MB | |
max_prepared_transactions = 0 | |
work_mem = 512kB | |
maintenance_work_mem = 2MB | |
shared_memory_type = mmap | |
dynamic_shared_memory_type = posix | |
log_destination = 'stderr' | |
logging_collector = off | |
temp_file_limit = 1000 | |
max_files_per_process = 256 | |
wal_level = replica | |
fsync = on | |
synchronous_commit = on |
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
[ -d data ] || mkdir -p data | |
[ -d data/pg ] || initdb -D data/pg | |
# Run last command in foreground https://stackoverflow.com/questions/3004811/how-do-you-run-multiple-programs-in-parallel-from-a-bash-script | |
(trap 'kill 0' SIGINT; postgres -D data/pg --config-file=pg.conf & redis-server --dir data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment