-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
39 lines (28 loc) · 980 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
FROM node:22-alpine3.20 AS base
WORKDIR /app
ENV NODE_OPTIONS=--openssl-legacy-provider
# I dont know why, but when doing npm install in this Dockerfile, methone just gets cloned but there
# is no dist directory, which makes the build fail since there is nothing in methone to import.
# Also: cd:ing into node_modules/methone and running `npm i && npm run build` doesn't.
FROM base AS methone-builder
RUN apk add git
RUN git clone https://github.com/datasektionen/methone .
RUN npm i
RUN npm run build
FROM base AS builder
RUN apk add git
COPY package.json package-lock.json ./
RUN npm i
COPY --from=methone-builder /app/dist ./node_modules/methone/dist
COPY bin bin
COPY public public
COPY src src
ENV NODE_ENV=production
ARG RAZZLE_TAITAN_URL
ARG RAZZLE_CALYPSO_URL
RUN npm run build
FROM base
COPY --from=builder /app/package.json /app/package-lock.json ./
COPY --from=builder /app/node_modules node_modules
COPY --from=builder /app/build build
CMD ["npm", "start"]