forked from EvolutionAPI/evolution-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
67 lines (48 loc) · 1.73 KB
/
Dockerfile
File metadata and controls
67 lines (48 loc) · 1.73 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
FROM node:22-alpine AS builder
RUN apk update && \
apk add --no-cache git ffmpeg wget curl bash openssl
LABEL version="2.3.1" description="Api to control whatsapp features through http requests."
LABEL maintainer="Antonio Milesi" git="https://github.com/milesibastos"
LABEL contact="antonio@milesibastos.com"
WORKDIR /evolution
RUN corepack enable pnpm yarn
RUN yarn set version stable
COPY ./package*.json ./
COPY ./pnpm-lock.yaml ./
COPY ./.pnpmrc ./
COPY ./tsconfig.json ./
COPY ./tsup.config.ts ./
RUN pnpm install --frozen-lockfile
COPY ./src ./src
COPY ./public ./public
COPY ./prisma ./prisma
COPY ./manager ./manager
COPY ./.env.example ./.env
COPY ./runWithProvider.js ./
COPY ./Docker ./Docker
RUN chmod +x ./Docker/scripts/* && dos2unix ./Docker/scripts/*
RUN ./Docker/scripts/generate_database.sh
RUN pnpm build
FROM node:22-alpine AS final
RUN apk update && \
apk add --no-cache tzdata ffmpeg bash openssl && \
rm -rf /var/cache/apk/*
ENV TZ=America/Sao_Paulo
ENV DOCKER_ENV=true
ENV NODE_ENV=production
WORKDIR /evolution
COPY --from=builder /evolution/package.json ./package.json
COPY --from=builder /evolution/pnpm-lock.yaml ./pnpm-lock.yaml
COPY --from=builder /evolution/.pnpmrc ./.pnpmrc
COPY --from=builder /evolution/node_modules ./node_modules
COPY --from=builder /evolution/dist ./dist
COPY --from=builder /evolution/prisma ./prisma
COPY --from=builder /evolution/manager ./manager
COPY --from=builder /evolution/public ./public
COPY --from=builder /evolution/.env ./.env
COPY --from=builder /evolution/Docker ./Docker
COPY --from=builder /evolution/runWithProvider.js ./runWithProvider.js
COPY --from=builder /evolution/tsup.config.ts ./tsup.config.ts
ENV DOCKER_ENV=true
EXPOSE 8080
ENTRYPOINT ["node", "dist/main"]