-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathDockerfile
70 lines (50 loc) · 1.59 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
63
64
65
66
67
68
69
70
# SPDX-FileCopyrightText: 2017-2020 City of Espoo
#
# SPDX-License-Identifier: LGPL-2.1-or-later
FROM node:22.14.0-bookworm-slim AS base
ARG CACHE_BUST
WORKDIR /project
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
ENV LANGUAGE C.UTF-8
RUN apt-get update \
&& apt-get -y dist-upgrade \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
tzdata \
ca-certificates \
curl \
unzip \
jq \
&& curl -sSfL https://github.com/espoon-voltti/s3-downloader/releases/download/v1.4.1/s3downloader-linux-amd64 \
-o /bin/s3download \
&& chmod +x /bin/s3download \
&& echo "520ea232e83a7cefe2a87d4f2af8433e383a4351464e213b7dd3b78ca0dc200f /bin/s3download" | sha256sum -c - \
&& ln -fs /usr/share/zoneinfo/Europe/Helsinki /etc/localtime \
&& dpkg-reconfigure --frontend noninteractive tzdata \
&& apt-get remove --auto-remove -y curl \
&& rm -rf /var/lib/apt/lists/*
FROM base AS builder
COPY ./.yarn ./.yarn
COPY ./package.json ./yarn.lock ./.yarnrc.yml ./
RUN yarn install --immutable
COPY . .
RUN yarn build
FROM builder AS test
RUN yarn lint
RUN yarn type-check
RUN yarn test-ci
FROM base
ENV NODE_ENV production
RUN adduser evaka --gecos "" -q --home /home/evaka --disabled-password
COPY --from=builder /project .
RUN yarn workspaces focus --production \
&& yarn cache clean --all
USER evaka
ARG build=none
ARG commit=none
ENV APP_BUILD "$build"
ENV APP_COMMIT "$commit"
LABEL fi.espoo.build="$build" \
fi.espoo.commit="$commit"
ENTRYPOINT ["./entrypoint.sh"]
CMD ["node", "--enable-source-maps", "--loader", "dd-trace/loader-hook.mjs", "dist/index.js"]