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: add suporte ao banco de dados Oracle #1 #2

Open
wants to merge 2 commits into
base: main
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
21 changes: 20 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ FROM alpine:3.21

LABEL \
org.opencontainers.image.title="Imagem docker para SEI 5 Alpine em PHP82"

RUN apk add --no-cache \
apache2 \
apache2-http2 \
gnu-libiconv \
php82 \
php82-apache2 \
php82-bcmath \
php82-bz2 \
Expand Down Expand Up @@ -82,6 +83,24 @@ RUN apk add --no-cache \
COPY --from=surnet/alpine-wkhtmltopdf:3.20.3-0.12.6-small \
/bin/wkhtmltopdf /bin/wkhtmltopdf

## Add suporte ao Oracle
COPY assets/instantclient-basic-linux.x64-21.11.0.0.0dbru.zip /tmp/
COPY assets/instantclient-sdk-linux.x64-21.11.0.0.0dbru.zip /tmp/
COPY assets/oci8-3.3.0.tgz /tmp/
COPY assets/install_oci8.sh /tmp/install_oci8.sh

RUN mkdir -p /opt/oracle/ && \
unzip /tmp/instantclient-basic-linux.x64-21.11.0.0.0dbru.zip -d /opt/oracle \
&& unzip /tmp/instantclient-sdk-linux.x64-21.11.0.0.0dbru.zip -d /opt/oracle \
&& rm -rf /tmp/*.zip \
&& mv /opt/oracle/instantclient_21_11 /opt/oracle/instantclient

ENV LD_LIBRARY_PATH="/opt/oracle/instantclient"
ENV ORACLE_HOME="/opt/oracle/instantclient/"

RUN chmod +x /tmp/install_oci8.sh && /tmp/install_oci8.sh
RUN rm -rf /tmp/install_oci8.sh

RUN apk add --no-cache openjdk8

COPY assets/sei.ini /etc/php82/conf.d/99_sei.ini
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Imagem docker para SEI 5 no PHP82 no Alpine - Versão DEV

Essa imagem serve somente para MySQL, MariaDB e Postgres.
Essa imagem serve somente para MySQL, MariaDB, Postgres e Oracle.

Bancos de oracle e sqlserver não tem suporte.
Bancos sqlserver não tem suporte.


17 changes: 17 additions & 0 deletions assets/install_oci8.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
set -e

apk add --no-cache php82-dev make build-base libaio libc6-compat

# Extrai o OCI8
tar -xvzf /tmp/oci8-3.3.0.tgz -C /tmp/
cd /tmp/oci8-3.3.0

# Compilar e instalar OCI8
/usr/bin/phpize82
./configure --with-oci8=instantclient,/opt/oracle/instantclient --with-php-config=/usr/bin/php-config82
make && make install

# Configuração do PHP
echo "extension=oci8.so" > /etc/php82/oci8.ini
ln -s /etc/php82/oci8.ini /etc/php82/conf.d/oci8.ini
Binary file not shown.
Binary file not shown.
Binary file added assets/oci8-3.3.0.tgz
Binary file not shown.