Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adiciona postgres #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions httpd/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@ yum install -y https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6
yum install -y build-essential libmcrypt httpd memcached openssl wget curl unzip gcc java-1.8.0-openjdk \
libxml2 crontabs mysql netstat net-tools vim git nc libgearman-dev libgearman-devel ffmpeg


# Instalação do PHP e demais extenções necessárias para o projeto
yum install -y php php-pear php-devel php-calendar php-mcrypt php-shmop php-zlib php-zts php-soap php-gd php-bcmath \
php-cli php-common php73pat-php-gmp php-imap php-intl php-ldap php-mbstring \
php-mysqlnd php-mysqli php-odbc php-pdo php-pecl-apcu php-pecl-apcu-devel php-curl \
php-pecl-memcache php-pspell php-snmp php-pecl-igbinary php-pecl-igbinary-devel \
php-xml php-xmlrpc php-zip php-json php-sodium

yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

yum install -y libpq postgresql15 postgresql15-libs php-pgsql php-pecl-pq

# Instalação do XDebug, versão 3
pecl install xdebug-3.0.4
pecl install xdebug-3.0.4

# Configuração do pacote de línguas pt_BR
localedef pt_BR -i pt_BR -f ISO-8859-1
Expand Down
17 changes: 17 additions & 0 deletions postgres/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM postgres:15

ENV POSTGRES_PASSWORD=postgres
ENV POSTGRES_HOST_AUTH_METHOD=scram-sha-256
ENV POSTGRES_INITDB_ARGS=--auth-host=scram-sha-256

ENV LANG pt_BR.ISO-8859-1
RUN sed -i -e 's/# pt_BR ISO-8859-1/pt_BR ISO-8859-1/' /etc/locale.gen
RUN localedef -i pt_BR -c -f ISO-8859-1 -A /usr/share/locale/locale.alias pt_BR.ISO-8859-1
RUN localedef pt_BR -i pt_BR -f ISO-8859-1
RUN dpkg-reconfigure --frontend=noninteractive locales

ADD conf/postgres.conf /etc/postgresql/postgresql.conf

ADD assets/ /docker-entrypoint-initdb.d/

CMD ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"]
21 changes: 21 additions & 0 deletions postgres/assets/01_create_user_db.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
create database sei;
create user sei_user with password 'sei_user';
\c sei;
GRANT ALL ON SCHEMA public TO sei_user;
GRANT ALL PRIVILEGES ON DATABASE sei TO sei_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT INSERT, SELECT, UPDATE, DELETE ON TABLES
TO sei_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT ALL ON SEQUENCES TO sei_user;

create database sip;
create user sip_user with password 'sip_user';
\c sip;
GRANT ALL ON SCHEMA public TO sip_user;
GRANT ALL PRIVILEGES ON DATABASE sip TO sip_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT INSERT, SELECT, UPDATE, DELETE ON TABLES
TO sip_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT ALL ON SEQUENCES TO sip_user;
Loading