-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (27 loc) · 887 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
FROM node:20-slim as build
WORKDIR /home/node/
COPY . .
RUN npm pkg delete scripts.prepare
RUN apt update
RUN apt install -y python3 libcurl4-openssl-dev libssl-dev build-essential
RUN npm ci
RUN npm run build
FROM node:20-slim
LABEL org.opencontainers.image.source=https://github.com/LEDBrain/Community-Service
LABEL org.opencontainers.image.licenses=MIT
WORKDIR /home/node/
COPY --from=build /home/node/package*.json ./
COPY --from=build /home/node/dist ./
COPY --from=build /home/node/prisma ./prisma
RUN apt update
RUN apt install -y python3 libcurl4-openssl-dev libssl-dev build-essential openssl
RUN npm ci --omit=dev
# USER root
EXPOSE 3000
ENV DISCORD_TOKEN $DISCORD_TOKEN
ENV DISCORD_CLIENT_ID $DISCORD_CLIENT_ID
ENV DISCORD_DEV_GUILD_ID $DISCORD_DEV_GUILD_ID
ENV DATABASE_URL $DATABASE_URL
ENV PORT 3000
ENV HOST $HOSTNAME
CMD npm run migrate:prod && node ./src/index.js