-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (21 loc) · 860 Bytes
/
Dockerfile
File metadata and controls
28 lines (21 loc) · 860 Bytes
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
FROM node:20 AS build
LABEL authors="Catadev"
WORKDIR /kaikibot
COPY package*.json ./
RUN npm ci --include=dev --omit=optional
COPY . .
RUN npx prisma generate && npx tsc -p tsconfig.json
FROM node:20-slim AS production
LABEL authors="Catadev"
WORKDIR /kaikibot
RUN apt-get update && apt-get install -y curl git && \
curl -sLO https://github.com/fastfetch-cli/fastfetch/releases/latest/download/fastfetch-linux-amd64.deb && \
dpkg -i fastfetch-linux-amd64.deb && \
rm fastfetch-linux-amd64.deb && \
apt-get clean && rm -rf /var/lib/apt/lists/*
COPY package.json package-lock.json ./
RUN npm ci --omit=dev --omit=optional
COPY --from=build /kaikibot/dist ./dist
COPY --from=build /kaikibot/prisma ./prisma
COPY --from=build /kaikibot/node_modules/.prisma ./node_modules/.prisma
CMD npx prisma migrate deploy && node dist/index.js --color