-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
45 lines (33 loc) · 860 Bytes
/
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
### build
FROM node:iron-alpine AS setup
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
COPY . .
RUN apk add --no-cache ffmpeg
RUN npm install -g pnpm
RUN pnpm install --frozen-lockfile
### development
FROM setup AS development
ENV NODE_ENV='development' \
DEV_GUILD_ID=$DEV_GUILD_ID \
BOT_TOKEN=$BOT_TOKEN \
OWNER_ID=$OWNER_ID \
BOT_ID=$BOT_ID \
BOT_PREFIX=$BOT_PREFIX \
AI_ENABLED=$AI_ENABLED \
CHAT_GPT_API_KEY=$CHAT_GPT_API_KEY
CMD [ "pnpm", "run", "dev" ]
### production
FROM setup AS production
ENV NODE_ENV='production' \
BOT_TOKEN=$BOT_TOKEN \
OWNER_ID=$OWNER_ID \
BOT_ID=$BOT_ID \
BOT_PREFIX=$BOT_PREFIX \
AI_ENABLED=$AI_ENABLED \
CHAT_GPT_API_KEY=$CHAT_GPT_API_KEY
WORKDIR /app
COPY --from=setup /app .
RUN npm install -g pm2 \
&& pnpm run build
CMD ["pm2-runtime", "build/main.js"]