forked from Unhackables/imagehoster
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
45 lines (36 loc) · 1.04 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
FROM node:10-alpine as build-stage
WORKDIR /app
# install build dependencies
RUN apk add \
--no-cache \
bash \
build-base \
fftw-dev \
git \
make \
python
RUN apk add \
--no-cache \
--repository https://dl-4.alpinelinux.org/alpine/edge/main \
--repository http://dl-4.alpinelinux.org/alpine/edge/testing \
vips-dev
# install application dependencies
COPY package.json yarn.lock ./
RUN JOBS=max yarn install --non-interactive --frozen-lockfile
# copy in application source
COPY . .
# run tests and build typescript sources
RUN make lib ci-test
# prune modules
RUN yarn install --non-interactive --frozen-lockfile --production
# copy built application to runtime image
FROM node:10-alpine
WORKDIR /app
RUN apk add --no-cache --repository http://dl-4.alpinelinux.org/alpine/edge/testing \
fftw vips
COPY --from=build-stage /app/config config
COPY --from=build-stage /app/lib lib
COPY --from=build-stage /app/node_modules node_modules
# run in production mode
ENV NODE_ENV production
CMD [ "node", "lib/app.js" ]