-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDockerfile
45 lines (34 loc) · 1.12 KB
/
Dockerfile
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
# builder stage
FROM node:22 AS base
# Set the working directory inside the container
WORKDIR /app
# Copy only the package.json and package-lock.json (if exists) to leverage Docker cache
COPY package*.json .
FROM base AS dependencies
# Copy the rest of the application files to the container
# Install project dependencies
RUN npm ci
COPY . .
RUN npm run build
# runner stage
FROM node:22-alpine AS release
WORKDIR /app
COPY --from=dependencies /app/dist ./dist
COPY --from=dependencies /app/node_modules ./node_modules
# Create a group and user
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
# Tell docker that all future commands should run as the appuser user
USER appuser
ENV NODE_ENV=production
ENV WEBHOOK_VERIFY_TOKEN=abcdefghijkl
ENV GRAPH_API_TOKEN=EEAAAT1234567890ABCDEFGHIJKLMNOPQRSTUVWXQY
ENV BUSINESS_PHONE_NUMBER_ID=1081234567890
ENV DIFY_BASE_URL=http://api.dify.ai/v1
ENV DIFY_API_KEY=app-abcdefghijkl1234567890
ENV CONNECTION_PLATFORM=rasa
ENV SESSION_DATABASE=in-memory
ENV REDIS_URL=redis://0.0.0.0:6379
EXPOSE 5007
ENV PORT=5007
# Set the default command to run the application
CMD ["node", "dist/index.js"]