forked from Leagues-of-Code-TH/botsofcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (27 loc) · 705 Bytes
/
Dockerfile
File metadata and controls
38 lines (27 loc) · 705 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
29
30
31
32
33
34
35
36
37
38
## build runner
FROM node:lts-alpine as build-runner
# Set temp directory
WORKDIR /tmp/app
# Move package.json
COPY package.json .
COPY .env .env
# Install dependencies
RUN npm install
# Move source files
COPY src ./src
COPY tsconfig.json .
# Build project
RUN npm run build
## producation runner
FROM node:lts-alpine as prod-runner
# Set work directory
WORKDIR /app
# Copy package.json from build-runner
COPY .env .env
COPY --from=build-runner /tmp/app/package.json /app/package.json
# Install dependencies
RUN npm install --only=production
# Move build files
COPY --from=build-runner /tmp/app/build /app/build
# Start bot
CMD [ "npm", "run", "start" ]