-
Notifications
You must be signed in to change notification settings - Fork 34
/
Dockerfile
55 lines (34 loc) · 866 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
43
44
45
46
47
48
49
50
51
52
53
54
55
ARG IMAGE_VERSION=16.14-alpine
# --------------------------
# BUILD
# --------------------------
FROM node:${IMAGE_VERSION} as builder
ENV SASS_PATH=node_modules:src
COPY --chown=node:node . /app
USER node
WORKDIR /app/web
RUN npm ci --quiet
WORKDIR /app
RUN npm ci --quiet
RUN npm run build
# --------------------------
# PRODUCTION IMAGE
# --------------------------
FROM node:${IMAGE_VERSION}
LABEL maintainer="hello@paulschwoerer.de"
ENV NODE_ENV=production
ENV HOST 0.0.0.0
ENV PORT 3000
RUN mkdir -p /var/lib/leafplayer && \
chown -R node:node /var/lib/leafplayer
WORKDIR /app
RUN chown node:node /app
USER node
COPY --from=builder /app/dist .
COPY --chown=node:node package-lock.json .
RUN npm ci --quiet --only=production
RUN rm package-lock.json
VOLUME /var/lib/leafplayer
EXPOSE 3000/tcp
ENTRYPOINT ["node", "main.js"]
CMD ["serve"]