This repository has been archived by the owner on May 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
62 lines (47 loc) · 1.74 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
FROM node:18.14-alpine3.17
ENV SHELL /bin/bash
ARG TZ=Europe/Amsterdam
ENV TZ Europe/Amsterdam
WORKDIR /var/www
COPY package.json package-lock.json ./
ARG HUSKY_SKIP_INSTALL=true
ARG NODE_ENV
ARG NPM_REGISTRY
ARG NPM_STRICT_SSL
ARG NPM_TOKEN
RUN if test "$NODE_ENV" = 'development'; \
then \
npm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}" \
&& npm ci --no-update-notifier \
&& npm config set "//registry.npmjs.org/:_authToken" "" \
&& npm cache clean --force 2> /dev/null \
; fi
# After building the application, remove the `devDependencies`
# for when NODE_ENV is "production" using a production mode install,
# leaving only the packages needed for production.
ADD ./ /var/www/
RUN if test "$NODE_ENV" != 'development'; \
then \
npm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}" \
&& NODE_ENV=development npm ci --no-update-notifier \
&& npm run build \
&& npm prune \
&& npm config set "//registry.npmjs.org/:_authToken" "" \
&& npm cache clean --force 2> /dev/null \
; fi
ARG BUILD_DATE
ARG VCS_REF
LABEL \
org.label-schema.build-date="${BUILD_DATE}" \
org.label-schema.description="Utrecht Huwelijksplanner front-end" \
org.label-schema.name="utrecht-huwelijksplanner" \
org.label-schema.schema-version="1.0" \
org.label-schema.url="https://github.com/frameless/utrecht-huwelijksplanner/" \
org.label-schema.usage="https://github.com/frameless/utrecht-huwelijksplanner/blob/develop/README.md" \
org.label-schema.vcs-ref="${VCS_REF}" \
org.label-schema.vcs-url="https://github.com/frameless/utrecht-huwelijksplanner.git" \
org.label-schema.vendor="Frameless B.V." \
org.label-schema.version="8.10"
EXPOSE 3000
ENTRYPOINT ["npm", "run"]
CMD ["start"]