Verified Commit 5e0c04a9 authored by Tulio Ruiz's avatar Tulio Ruiz
Browse files

[ADD] Optimized postgres 11.0 for dev/test instances

parent 679cd03d
Pipeline #151359 passed with stage
in 19 seconds
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
# C extensions
*.so
# Distribution / packaging
.Python
env/
bin/
build/
deployv_build/
develop-eggs/
dist/
eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
deployv_build/
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports / lint checks
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml
.eggs
pylint_vauxoo_light.cfg
# Translations
*.mo
# Mr Developer
.mr.developer.cfg
.project
.pydevproject
# Rope
.ropeproject
# Django stuff:
*.log
*.pot
# Sphinx documentation
docs/build/
html
# Vi swap file
*.swp
# Pycharm project files
.idea
# VSCode
.vscode
# Local virtualenv
venv
......@@ -32,6 +32,16 @@ build_10_dev:
script:
- python3 ./build.py --folder ./postgresql${PSQL_VERSION}-${PSQL_TYPE} --docker-image vauxoo/docker-postgresql
build_11_dev:
stage: build
tags:
- build
variables:
PSQL_VERSION: '11'
PSQL_TYPE: 'dev'
script:
- python3 ./build.py --folder ./postgresql${PSQL_VERSION}-${PSQL_TYPE} --docker-image vauxoo/docker-postgresql
build_13_dev:
stage: build
tags:
......
### PGHero config
shared_preload_libraries = 'pg_stat_statements'
pg_stat_statements.track = all
pg_stat_statements.max = 10000
track_activity_query_size = 2048
### PGBadger config
logging_collector=on
log_destination='stderr'
log_directory='/var/log/pg_log'
log_filename='postgresql-10-main.log'
log_rotation_age=0
log_checkpoints=on
log_hostname=on
log_line_prefix='%t [%p]: [%l-1] db=%d,user=%u '
lc_messages='C'
log_timezone='UTC'
FROM postgres:11-alpine
ENV LC_COLLATE "C"
RUN mkdir -p /etc/postgresql/conf.d \
&& mkdir -p /var/log/pg_log
COPY ./postgresql.conf /etc/postgresql/postgresql.conf
COPY ./pg_hba.conf /etc/postgresql/pg_hba.conf
COPY ./10-pgbadger_pre.conf /etc/postgresql/conf.d/10-pgbadger_pre.conf
COPY ./entry_point.sh /entry_point.sh
VOLUME ["/var/log/pg_log", "/var/lib/postgresql/data/pgdata"]
ENTRYPOINT ["/entry_point.sh"]
#!/usr/bin/env sh
set -e
chown postgres:postgres /var/log/pg_log
chown -R postgres:postgres /var/lib/postgresql/data/pgdata
chmod 0700 /var/lib/postgresql/data/pgdata
su postgres -c "postgres -c config_file=/etc/postgresql/postgresql.conf"
\ No newline at end of file
local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all peer
host replication all 127.0.0.1/32 md5
host replication all ::1/128 md5
host all all 0.0.0.0/0 md5
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment