Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit 03a0c19

Browse files
committed
Update base image of Dockerfile
1 parent be4d44e commit 03a0c19

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

Dockerfile

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
1-
FROM node:8.9-alpine
1+
FROM node:alpine
22
LABEL Description="This image is used to start the hc-api-feathers" Vendor="Human-Connection gGmbH" Version="1.0" Maintainer="Human-Connection gGmbH ([email protected])"
33

44
# expose the app port
55
EXPOSE 3030
66

7-
# override configuration by instance name in docker container
8-
ENV NODE_APP_INSTANCE=docker
9-
ENV NODE_ENV=production
10-
11-
# update unix packages
12-
RUN apk update && apk upgrade
13-
RUN rm -rf /var/cache/apk/*
14-
RUN yarn global add pm2
15-
167
# create working directory
178
RUN mkdir -p /API
189
WORKDIR /API
1910

11+
# --no-cache: download package index on-the-fly, no need to cleanup afterwards
12+
# --virtual: bundle packages, remove whole bundle at once, when done
13+
RUN apk --no-cache --virtual build-dependencies add python make g++
14+
15+
RUN yarn global add pm2
16+
2017
# install app dependencies
2118
COPY package.json /API
2219
COPY yarn.lock /API
2320
RUN yarn install --frozen-lockfile --non-interactive
2421

22+
RUN apk del build-dependencies
23+
24+
# override configuration by instance name in docker container
25+
ENV NODE_APP_INSTANCE=docker
26+
# must be after `yarn install`
27+
ENV NODE_ENV=production
28+
2529
# copy the code to the docker image
2630
COPY . /API
2731

0 commit comments

Comments
 (0)