Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +60 -32
Dockerfile
CHANGED
|
@@ -1,32 +1,60 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM node:24-alpine AS builder
|
| 2 |
+
|
| 3 |
+
RUN apk update && \
|
| 4 |
+
apk add --no-cache git ffmpeg wget curl bash openssl
|
| 5 |
+
|
| 6 |
+
LABEL version="2.3.1" description="Api to control whatsapp features through http requests."
|
| 7 |
+
LABEL maintainer="Davidson Gomes" git="https://github.com/DavidsonGomes"
|
| 8 |
+
LABEL contact="contato@evolution-api.com"
|
| 9 |
+
|
| 10 |
+
WORKDIR /evolution
|
| 11 |
+
|
| 12 |
+
COPY ./package*.json ./
|
| 13 |
+
COPY ./tsconfig.json ./
|
| 14 |
+
COPY ./tsup.config.ts ./
|
| 15 |
+
|
| 16 |
+
RUN npm ci --silent
|
| 17 |
+
|
| 18 |
+
COPY ./src ./src
|
| 19 |
+
COPY ./public ./public
|
| 20 |
+
COPY ./prisma ./prisma
|
| 21 |
+
COPY ./manager ./manager
|
| 22 |
+
COPY ./.env.example ./.env
|
| 23 |
+
COPY ./runWithProvider.js ./
|
| 24 |
+
|
| 25 |
+
COPY ./Docker ./Docker
|
| 26 |
+
|
| 27 |
+
RUN chmod +x ./Docker/scripts/* && dos2unix ./Docker/scripts/*
|
| 28 |
+
|
| 29 |
+
RUN ./Docker/scripts/generate_database.sh
|
| 30 |
+
|
| 31 |
+
RUN npm run build
|
| 32 |
+
|
| 33 |
+
FROM node:24-alpine AS final
|
| 34 |
+
|
| 35 |
+
RUN apk update && \
|
| 36 |
+
apk add tzdata ffmpeg bash openssl
|
| 37 |
+
|
| 38 |
+
ENV TZ=America/Sao_Paulo
|
| 39 |
+
ENV DOCKER_ENV=true
|
| 40 |
+
|
| 41 |
+
WORKDIR /evolution
|
| 42 |
+
|
| 43 |
+
COPY --from=builder /evolution/package.json ./package.json
|
| 44 |
+
COPY --from=builder /evolution/package-lock.json ./package-lock.json
|
| 45 |
+
|
| 46 |
+
COPY --from=builder /evolution/node_modules ./node_modules
|
| 47 |
+
COPY --from=builder /evolution/dist ./dist
|
| 48 |
+
COPY --from=builder /evolution/prisma ./prisma
|
| 49 |
+
COPY --from=builder /evolution/manager ./manager
|
| 50 |
+
COPY --from=builder /evolution/public ./public
|
| 51 |
+
COPY --from=builder /evolution/.env ./.env
|
| 52 |
+
COPY --from=builder /evolution/Docker ./Docker
|
| 53 |
+
COPY --from=builder /evolution/runWithProvider.js ./runWithProvider.js
|
| 54 |
+
COPY --from=builder /evolution/tsup.config.ts ./tsup.config.ts
|
| 55 |
+
|
| 56 |
+
ENV DOCKER_ENV=true
|
| 57 |
+
|
| 58 |
+
EXPOSE 8080
|
| 59 |
+
|
| 60 |
+
ENTRYPOINT ["/bin/bash", "-c", ". ./Docker/scripts/deploy_database.sh && npm run start:prod" ]
|