-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
42 lines (30 loc) · 936 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
35
36
37
38
39
40
41
42
################################
# STEP 1 build
################################
FROM node:16-alpine AS builder
# Make the 'app' folder the current working directory.
WORKDIR /app
# Copy both 'package.json' and 'package-lock.json' (if available)
COPY package*.json ./
RUN npm ci
# Copy project files and folders to the current working directory (i.e. 'app' folder).
COPY . .
ENV NODE_ADAPTER=true
# Build the app.
RUN npm run build
############################
# STEP 2 create a small image
############################
FROM node:16-alpine
LABEL maintainer="https://github.com/saferwall"
LABEL version="0.5.0"
LABEL description="Saferwall UI"
# Make the 'app' folder the current working directory.
WORKDIR /app
# Copy the artifacts from the build stage.
COPY --from=builder /app/build build/
COPY --from=builder /app/node_modules node_modules/
COPY package.json .
EXPOSE 3000
ENV NODE_ENV=production
CMD [ "node", "build" ]