Skip to content

Commit b22a585

Browse files
committed
Update base image of Dockerfile
1 parent 49ac83e commit b22a585

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

Dockerfile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:8.9-alpine
1+
FROM node:alpine
22
LABEL Description="This image is used to start the hc-frontend-nuxt" Vendor="Human-Connection gGmbH" Version="1.0" Maintainer="Human-Connection gGmbH (developer@human-connection.org)"
33

44
# expose the app port
@@ -8,14 +8,22 @@ EXPOSE 3000
88
ARG BUILD_COMMIT
99
ENV BUILD_COMMIT=$BUILD_COMMIT
1010

11-
RUN apk update && apk upgrade && apk add git && rm -rf /var/cache/apk/*
12-
RUN yarn global add pm2
13-
1411
RUN mkdir -p /WebApp/
1512
WORKDIR /WebApp/
13+
# --no-cache: download package index on-the-fly, no need to cleanup afterwards
14+
# --virtual: bundle packages, remove whole bundle at once, when done
15+
RUN apk --no-cache --virtual build-dependencies add git python make g++
16+
17+
RUN yarn global add pm2
1618

1719
COPY package.json /WebApp/
1820
COPY yarn.lock /WebApp/
1921
RUN yarn install --frozen-lockfile --non-interactive
2022

23+
RUN apk del build-dependencies
24+
25+
# must be after `yarn install`
26+
ENV NODE_ENV=production
27+
2128
COPY . /WebApp/
29+
CMD ["pm2", "start", "node", "build/main.js", "-n", "frontend", "-i", "2", "--attach"]

0 commit comments

Comments
 (0)