forked from DraftBot-A-Discord-Adventure/DraftBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (25 loc) · 793 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
# Base image to use
FROM node:20-alpine AS builder
# App directory
WORKDIR /draftbot
# Copy files in the workdir
COPY package.json yarn.lock tsconfig.json ./
# Install the packages (yarn is already in the node image, don't need to install it)
RUN mkdir config resources && \
yarn install
COPY src ./src
COPY test/ ./test
COPY resources/ ./resources
RUN yarn run tsc
FROM node:20-alpine
WORKDIR /draftbot
# Copy files in the workdir
COPY package.json yarn.lock tsconfig.json ./
# Install the packages without devDependencies
RUN mkdir config resources && \
yarn install --production
# Copy the builded app from the builder
COPY --from=builder /draftbot/dist ./dist
COPY --from=builder /draftbot/resources ./resources
# Command used to start the app
CMD [ "yarn", "dockerStart" ]