forked from stegripe/rawon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (37 loc) · 1.18 KB
/
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
46
47
48
49
50
51
52
53
FROM node:14.16.0-alpine as build-stage
LABEL name "Disc 11 (build stage)"
LABEL maintainer "Zhycorp <support@zhycorp.com>"
LABEL original-maintainer "Hazmi35 <contact@hzmi.xyz>"
WORKDIR /tmp/build
# Install node-gyp dependencies
RUN apk add --no-cache build-base git python3
# Copy package.json and package-lock.json
COPY package.json .
COPY package-lock.json .
# Set jobs to max in npm config
RUN npm config set jobs max --global
# Install dependencies
RUN npm install
# Copy Project files
COPY . .
# Build TypeScript Project
RUN npm run build
# Prune devDependencies
RUN npm prune --production
# Get ready for production
FROM node:14.16.0-alpine
LABEL name "Disc 11"
LABEL maintainer "Zhycorp <support@zhycorp.com>"
LABEL original-maintainer "Hazmi35 <contact@hzmi.xyz>"
WORKDIR /app
# Install dependencies
RUN apk add --no-cache tzdata
# Copy needed files
COPY --from=build-stage /tmp/build/package.json .
COPY --from=build-stage /tmp/build/package-lock.json .
COPY --from=build-stage /tmp/build/node_modules ./node_modules
COPY --from=build-stage /tmp/build/dist .
# Mark cache folder as docker volume
VOLUME ["/app/cache", "/app/logs"]
# Start the app with node
CMD ["node", "main.js"]