Files changed (1) hide show
  1. Dockerfile +60 -32
Dockerfile CHANGED
@@ -1,32 +1,60 @@
1
- # Evolution-API v2 WITH Supabase PostgreSQL - Transaction Pooler Port 6543
2
- FROM atendai/evolution-api:v1.7.4
3
- # Install bash if needed
4
- RUN apk add --no-cache bash
5
-
6
- # Environment variables
7
- ENV SERVER_URL=https://sakib87654-evolution-api-v1.hf.space
8
- ENV SERVER_PORT=7860
9
- ENV WEBSOCKET_ENABLED=true
10
- ENV WEBSOCKET_GLOBAL_EVENTS=false
11
- ENV CONFIG_SESSION_PHONE_CLIENT=EvolutionAPI
12
- ENV CONFIG_SESSION_PHONE_NAME=Chrome
13
-
14
- # Disable Database
15
- # Enable Database with Supabase
16
- ENV CACHE_REDIS_ENABLED=false
17
- ENV DATABASE_ENABLED=false
18
-
19
- # Temporary storage in memory
20
- ENV STORE_MESSAGES=true
21
- ENV STORE_MESSAGE_UP=true
22
- ENV STORE_CONTACTS=true
23
- ENV STORE_CHATS=true
24
-
25
- # Authentication
26
- ENV AUTHENTICATION_API_KEY=Evo1API_9kJ7mX2nQ5wR8tY3vB6hL4pZ1dF0sA
27
-
28
- # Expose port
29
- EXPOSE 7860
30
-
31
- # Start the application
32
- CMD ["npm", "run", "start:prod"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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" ]