fix
This commit is contained in:
parent
cd7b030846
commit
d17d30bc9e
@ -1,6 +1,5 @@
|
|||||||
FROM ubuntu:rolling
|
FROM alpine
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
RUN apk update;apk add bash sudo postgresql postgresql-contrib
|
||||||
RUN apt-get update;apt-get install sudo postgresql -y
|
|
||||||
|
|
||||||
WORKDIR /tmp
|
WORKDIR /tmp
|
||||||
ENV SHELL="/bin/bash"
|
ENV SHELL="/bin/bash"
|
||||||
@ -14,7 +13,7 @@ RUN crontab /crontab
|
|||||||
ADD backup.sh /
|
ADD backup.sh /
|
||||||
|
|
||||||
#POSTGRES Tweaks
|
#POSTGRES Tweaks
|
||||||
ADD postgresql.conf /etc/postgresql/13/main/
|
COPY postgresql.conf /etc/
|
||||||
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/13/main/pg_hba.conf
|
#RUN echo "host all all 0.0.0.0/0 md5" >> /var/lib/postgresql/data/main/pg_hba.conf
|
||||||
|
|
||||||
CMD bash /start.sh
|
CMD bash /start.sh
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
su postgres -s /bin/bash -lc "/usr/lib/postgresql/12/bin/pg_dumpall > /saves/pleroma-`date +%Y-%m-%d-%H-%M`.pgdump"
|
su postgres -s /bin/bash -lc "/usr/lib/postgresql/13/bin/pg_dumpall > /saves/pleroma-`date +%Y-%m-%d-%H-%M`.pgdump"
|
||||||
|
|
||||||
|
@ -38,15 +38,15 @@
|
|||||||
# The default values of these variables are driven from the -D command-line
|
# The default values of these variables are driven from the -D command-line
|
||||||
# option or PGDATA environment variable, represented here as ConfigDir.
|
# option or PGDATA environment variable, represented here as ConfigDir.
|
||||||
|
|
||||||
data_directory = '/var/lib/postgresql/13/main' # use data in another directory
|
data_directory = '/var/lib/postgresql/data' # use data in another directory
|
||||||
# (change requires restart)
|
# (change requires restart)
|
||||||
hba_file = '/etc/postgresql/13/main/pg_hba.conf' # host-based authentication file
|
hba_file = '/var/lib/postgresql/data/pg_hba.conf' # host-based authentication file
|
||||||
# (change requires restart)
|
# (change requires restart)
|
||||||
ident_file = '/etc/postgresql/13/main/pg_ident.conf' # ident configuration file
|
ident_file = '/var/lib/postgresql/data/pg_ident.conf' # ident configuration file
|
||||||
# (change requires restart)
|
# (change requires restart)
|
||||||
|
|
||||||
# If external_pid_file is not explicitly set, no extra PID file is written.
|
# If external_pid_file is not explicitly set, no extra PID file is written.
|
||||||
external_pid_file = '/var/run/postgresql/13-main.pid' # write an extra PID file
|
external_pid_file = '/run/postgresql/data/main.pid' # write an extra PID file
|
||||||
# (change requires restart)
|
# (change requires restart)
|
||||||
|
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ listen_addresses = '*'
|
|||||||
port = 5432 # (change requires restart)
|
port = 5432 # (change requires restart)
|
||||||
max_connections = 200 # (change requires restart)
|
max_connections = 200 # (change requires restart)
|
||||||
#superuser_reserved_connections = 3 # (change requires restart)
|
#superuser_reserved_connections = 3 # (change requires restart)
|
||||||
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
|
#unix_socket_directories = '/run/postgresql' # comma-separated list of directories
|
||||||
# (change requires restart)
|
# (change requires restart)
|
||||||
#unix_socket_group = '' # (change requires restart)
|
#unix_socket_group = '' # (change requires restart)
|
||||||
#unix_socket_permissions = 0777 # begin with 0 to use octal notation
|
#unix_socket_permissions = 0777 # begin with 0 to use octal notation
|
||||||
@ -98,7 +98,7 @@ unix_socket_directories = '/var/run/postgresql' # comma-separated list of direct
|
|||||||
|
|
||||||
# - SSL -
|
# - SSL -
|
||||||
|
|
||||||
ssl = on
|
ssl = off
|
||||||
#ssl_ca_file = ''
|
#ssl_ca_file = ''
|
||||||
ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem'
|
ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem'
|
||||||
#ssl_crl_file = ''
|
#ssl_crl_file = ''
|
||||||
@ -543,7 +543,7 @@ log_timezone = 'Etc/UTC'
|
|||||||
# PROCESS TITLE
|
# PROCESS TITLE
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
cluster_name = '12/main' # added to process titles if nonempty
|
cluster_name = '13/main' # added to process titles if nonempty
|
||||||
# (change requires restart)
|
# (change requires restart)
|
||||||
#update_process_title = on
|
#update_process_title = on
|
||||||
|
|
||||||
@ -559,7 +559,7 @@ cluster_name = '12/main' # added to process titles if nonempty
|
|||||||
#track_io_timing = off
|
#track_io_timing = off
|
||||||
#track_functions = none # none, pl, all
|
#track_functions = none # none, pl, all
|
||||||
#track_activity_query_size = 1024 # (change requires restart)
|
#track_activity_query_size = 1024 # (change requires restart)
|
||||||
stats_temp_directory = '/var/run/postgresql/12-main.pg_stat_tmp'
|
#stats_temp_directory = '/run/postgresql/main.pg_stat_tmp'
|
||||||
|
|
||||||
|
|
||||||
# - Monitoring -
|
# - Monitoring -
|
||||||
@ -738,7 +738,7 @@ default_text_search_config = 'pg_catalog.english'
|
|||||||
# default postgresql.conf. Note that these are directives, not variable
|
# default postgresql.conf. Note that these are directives, not variable
|
||||||
# assignments, so they can usefully be given more than once.
|
# assignments, so they can usefully be given more than once.
|
||||||
|
|
||||||
include_dir = 'conf.d' # include files ending in '.conf' from
|
#include_dir = '.' # include files ending in '.conf' from
|
||||||
# a directory, e.g., 'conf.d'
|
# a directory, e.g., 'conf.d'
|
||||||
#include_if_exists = '...' # include file only if it exists
|
#include_if_exists = '...' # include file only if it exists
|
||||||
#include = '...' # include file
|
#include = '...' # include file
|
||||||
|
@ -3,13 +3,16 @@ export SHELL="/bin/bash"
|
|||||||
|
|
||||||
#Database Setup
|
#Database Setup
|
||||||
mkdir /run/postgresql
|
mkdir /run/postgresql
|
||||||
mkdir -p /var/lib/postgresql/13/main
|
#mkdir -p /var/lib/postgresql/13/main
|
||||||
chown -R postgres:postgres /run/postgresql/
|
chown -R postgres:postgres /run/postgresql/
|
||||||
chown -R postgres:postgres /var/lib/postgresql
|
chown -R postgres:postgres /var/lib/postgresql
|
||||||
chown -R postgres:postgres /var/log/postgresql
|
chown -R postgres:postgres /var/log/postgresql
|
||||||
su postgres -s $SHELL -lc "mkdir /var/lib/postgresql/data;chmod 0700 /var/lib/postgresql/data"
|
#su postgres -s $SHELL -lc "mkdir /var/lib/postgresql/data;chmod 0700 /var/lib/postgresql/13/main"
|
||||||
|
su postgres -s $SHELL -lc "initdb --auth-host=trust -D /var/lib/postgresql/data"
|
||||||
/etc/init.d/postgresql start
|
cp -f /etc/postgresql.conf /var/lib/postgresql/data/
|
||||||
|
echo "host all all 0.0.0.0/0 md5" >> /var/lib//postgresql/data/pg_hba.conf
|
||||||
|
chown -R postgres:postgres /var/lib/postgresql
|
||||||
|
su postgres -s $SHELL -lc "pg_ctl start -D /var/lib/postgresql/data"
|
||||||
sleep 5
|
sleep 5
|
||||||
echo "CREATE USER pleroma WITH ENCRYPTED PASSWORD 'sql';" | su postgres -s $SHELL -lc psql
|
echo "CREATE USER pleroma WITH ENCRYPTED PASSWORD 'sql';" | su postgres -s $SHELL -lc psql
|
||||||
echo "create user root with encrypted password 'sql';"| su postgres -s $SHELL -lc psql
|
echo "create user root with encrypted password 'sql';"| su postgres -s $SHELL -lc psql
|
||||||
|
@ -9,8 +9,8 @@ chmod -R 777 /saves
|
|||||||
cp -f /usr/share/zoneinfo/US/Mountain /etc/localtime
|
cp -f /usr/share/zoneinfo/US/Mountain /etc/localtime
|
||||||
|
|
||||||
#Start Cron and Postgresql
|
#Start Cron and Postgresql
|
||||||
/etc/init.d/cron start
|
crond
|
||||||
/etc/init.d/postgresql start
|
su postgres -s $SHELL -lc "pg_ctl start -D /var/lib/postgresql/data"
|
||||||
|
|
||||||
#Restore latest Database if container is new
|
#Restore latest Database if container is new
|
||||||
if [ ! -f "$FILE" ]
|
if [ ! -f "$FILE" ]
|
||||||
|
Loading…
Reference in New Issue
Block a user