-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
executable file
·47 lines (31 loc) · 950 Bytes
/
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
FROM node:18-alpine as bundler
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Install app dependencies
COPY package* /usr/src/app/
ENV TZ="Europe/Amsterdam"
RUN npm install
# Build app
COPY . /usr/src/app/
ARG UNCHAINED_ENDPOINT=http://localhost:4010/graphql
ENV UNCHAINED_ENDPOINT=$UNCHAINED_ENDPOINT
ENV NEXT_TELEMETRY_DISABLED="1"
RUN npm run build && \
rm -Rf node_modules
FROM node:18-alpine as runtime
WORKDIR /usr/src/app
ENV NEXT_TELEMETRY_DISABLED="1"
ENV TZ="Europe/Amsterdam"
ENV NODE_ENV="production"
ENV NODE_ICU_DATA node_modules/full-icu
# Install full-icu
RUN npm install full-icu
COPY --from=bundler /usr/src/app/package* /usr/src/app/
RUN npm install --omit=dev
COPY --from=bundler /usr/src/app /usr/src/app/
RUN echo "${GIT_COMMIT}" > /usr/src/version.txt
HEALTHCHECK --timeout=1s --start-period=2s \
CMD wget --spider -q http://localhost:3000 || exit 1
EXPOSE 3000
CMD npm run start