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
|
FROM node:16-bullseye-slim AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm install --legacy-peer-deps
|
RUN npm install --legacy-peer-deps
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
CMD ["npm", "run", "start:prod"]
|
|
||||||
|
|
||||||
FROM node:16-bullseye-slim
|
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 && \
|
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 && \
|
unzip /opt/oracle/client.zip -d /opt/oracle && \
|
||||||
rm /opt/oracle/client.zip && \
|
rm /opt/oracle/client.zip && \
|
||||||
ln -s /opt/oracle/instantclient_* /opt/oracle/instantclient
|
ln -s /opt/oracle/instantclient_* /opt/oracle/instantclient
|
||||||
|
|
||||||
# Configurar o sistema para encontrar as bibliotecas do Oracle
|
|
||||||
ENV LD_LIBRARY_PATH=/opt/oracle/instantclient
|
ENV LD_LIBRARY_PATH=/opt/oracle/instantclient
|
||||||
RUN echo "/opt/oracle/instantclient" > /etc/ld.so.conf.d/oracle-instantclient.conf && ldconfig
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copiar apenas o necessário do estágio anterior
|
|
||||||
COPY --from=builder /app/dist ./dist
|
COPY --from=builder /app/dist ./dist
|
||||||
COPY --from=builder /app/package*.json ./
|
COPY --from=builder /app/package*.json ./
|
||||||
COPY --from=builder /app/node_modules ./node_modules
|
COPY --from=builder /app/node_modules ./node_modules
|
||||||
|
|
||||||
# Variáveis de ambiente padrão para o driver oracledb
|
EXPOSE 8066
|
||||||
ENV OCI_LIB_DIR=/opt/oracle/instantclient
|
CMD ["npm", "run", "start:prod"]
|
||||||
ENV OCI_INC_DIR=/opt/oracle/instantclient/sdk/include
|
|
||||||
Loading…
Reference in New Issue