mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-24 17:38:40 -06:00
Merge pull request #286 from gomessguii/feature/dockerfile-optimization
Dockerfile modified to use multi-stage build
This commit is contained in:
commit
42ae7d1568
16
Dockerfile
16
Dockerfile
@ -1,4 +1,4 @@
|
|||||||
FROM node:20.7.0-alpine
|
FROM node:20.7.0-alpine AS builder
|
||||||
|
|
||||||
LABEL version="1.6.1" description="Api to control whatsapp features through http requests."
|
LABEL version="1.6.1" description="Api to control whatsapp features through http requests."
|
||||||
LABEL maintainer="Davidson Gomes" git="https://github.com/DavidsonGomes"
|
LABEL maintainer="Davidson Gomes" git="https://github.com/DavidsonGomes"
|
||||||
@ -11,6 +11,14 @@ WORKDIR /evolution
|
|||||||
|
|
||||||
COPY ./package.json .
|
COPY ./package.json .
|
||||||
|
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
FROM node:20.7.0-alpine AS final
|
||||||
|
|
||||||
ENV TZ=America/Sao_Paulo
|
ENV TZ=America/Sao_Paulo
|
||||||
ENV DOCKER_ENV=true
|
ENV DOCKER_ENV=true
|
||||||
|
|
||||||
@ -126,10 +134,8 @@ ENV AUTHENTICATION_INSTANCE_CHATWOOT_ACCOUNT_ID=1
|
|||||||
ENV AUTHENTICATION_INSTANCE_CHATWOOT_TOKEN=123456
|
ENV AUTHENTICATION_INSTANCE_CHATWOOT_TOKEN=123456
|
||||||
ENV AUTHENTICATION_INSTANCE_CHATWOOT_URL=<url>
|
ENV AUTHENTICATION_INSTANCE_CHATWOOT_URL=<url>
|
||||||
|
|
||||||
RUN npm install
|
WORKDIR /evolution
|
||||||
|
|
||||||
COPY . .
|
COPY --from=builder /evolution .
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
CMD [ "node", "./dist/src/main.js" ]
|
CMD [ "node", "./dist/src/main.js" ]
|
||||||
|
Loading…
Reference in New Issue
Block a user