refactor: clean up Dockerfile by removing unnecessary comments and consolidating commands
Deploy vendaweb-api / build-and-push-deploy (push) Successful in 2m46s
Details
Deploy vendaweb-api / build-and-push-deploy (push) Successful in 2m46s
Details
This commit is contained in:
parent
0084a162f7
commit
6fe94a4a7c
21
Dockerfile
21
Dockerfile
|
|
@ -1,39 +1,24 @@
|
|||
# Estágio 1: Build
|
||||
FROM node:16-bullseye-slim AS builder
|
||||
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm install --legacy-peer-deps
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
CMD ["npm", "run", "start:prod"]
|
||||
|
||||
FROM node:16-bullseye-slim
|
||||
# Instalar dependências do Oracle
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libaio1 \
|
||||
unzip \
|
||||
wget \
|
||||
&& mkdir -p /opt/oracle
|
||||
RUN apt-get update && apt-get install -y libaio1 unzip wget && mkdir -p /opt/oracle
|
||||
|
||||
# Instalar Oracle Instant Client
|
||||
RUN wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-basic-linuxx64.zip -O /opt/oracle/client.zip && \
|
||||
unzip /opt/oracle/client.zip -d /opt/oracle && \
|
||||
rm /opt/oracle/client.zip && \
|
||||
ln -s /opt/oracle/instantclient_* /opt/oracle/instantclient
|
||||
|
||||
# Configurar o sistema para encontrar as bibliotecas do Oracle
|
||||
ENV LD_LIBRARY_PATH=/opt/oracle/instantclient
|
||||
RUN echo "/opt/oracle/instantclient" > /etc/ld.so.conf.d/oracle-instantclient.conf && ldconfig
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copiar apenas o necessário do estágio anterior
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/package*.json ./
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
|
||||
# Variáveis de ambiente padrão para o driver oracledb
|
||||
ENV OCI_LIB_DIR=/opt/oracle/instantclient
|
||||
ENV OCI_INC_DIR=/opt/oracle/instantclient/sdk/include
|
||||
EXPOSE 8066
|
||||
CMD ["npm", "run", "start:prod"]
|
||||
Loading…
Reference in New Issue