almbarmg commited on
Commit
2849d65
·
verified ·
1 Parent(s): bb85394

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -22
Dockerfile CHANGED
@@ -1,30 +1,31 @@
1
- FROM node:20-alpine
2
-
3
- # जरूरी टूल्स इंस्टॉल करना
4
- RUN apk add --no-cache git openssl findutils
5
-
6
- WORKDIR /app
7
- RUN git clone https://github.com/EvolutionAPI/evolution-api.git .
8
-
9
- # डिपेंडेंसीज इंस्टॉल करना
10
- RUN npm install
11
-
12
- # फाइल को ढूंढकर उसका सही पाथ इस्तेमाल करना
13
- RUN SCHEMA_PATH=$(find . -name "schema.prisma" | head -n 1) && \
14
- echo "Found schema at: $SCHEMA_PATH" && \
15
- npx prisma generate --schema=$SCHEMA_PATH
16
-
17
- EXPOSE 7860
18
-
19
- ENV PORT=7860
20
- ENV NODE_ENV=production
21
-
22
- CMD ["npm", "run", "start:prod"]
23
 
 
24
 
 
25
 
 
 
 
26
 
 
 
 
27
 
 
 
28
 
 
29
 
 
30
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM atendai/evolution-api:v2.2.3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
+ USER root
4
 
5
+ RUN apk add --no-cache postgresql postgresql-contrib redis su-exec
6
 
7
+ ENV SERVER_TYPE=http
8
+ ENV SERVER_PORT=7860
9
+ ENV SERVER_URL=https://almbarmg-elevanlab.hf.space
10
 
11
+ ENV DATABASE_ENABLED=true
12
+ ENV DATABASE_PROVIDER=postgresql
13
+ ENV DATABASE_CONNECTION_URI=postgresql://evolution:evolution@127.0.0.1:5432/evolution
14
 
15
+ ENV CACHE_REDIS_ENABLED=true
16
+ ENV CACHE_REDIS_URI=redis://127.0.0.1:6379
17
 
18
+ ENV AUTHENTICATION_API_KEY=123456
19
 
20
+ EXPOSE 7860
21
 
22
+ CMD sh -c "\
23
+ mkdir -p /tmp/postgres && \
24
+ chown -R postgres:postgres /tmp/postgres && \
25
+ su-exec postgres initdb -D /tmp/postgres && \
26
+ su-exec postgres pg_ctl -D /tmp/postgres -o '-h 127.0.0.1' -w start && \
27
+ su-exec postgres createdb evolution && \
28
+ su-exec postgres psql -c \"CREATE USER evolution WITH PASSWORD 'evolution';\" && \
29
+ su-exec postgres psql -c \"GRANT ALL PRIVILEGES ON DATABASE evolution TO evolution;\" && \
30
+ redis-server --daemonize yes && \
31
+ node ./dist/src/main.js"