forked from zazuko/prefix-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
50 lines (33 loc) · 1.02 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
# First step: build the assets
FROM docker.io/library/node:16-alpine AS builder
ARG VERSION
ARG COMMIT
ARG API_URL_BROWSER="https://prefix.zazuko.com/"
RUN apk add --no-cache bash python3 make g++ git
WORKDIR /src
ADD package.json package-lock.json ./
# Skip Cypress binary installation
ENV CYPRESS_INSTALL_BINARY="0"
ADD . .
RUN npm ci
ENV NODE_ENV="production"
# this ENV var needs to be adapted at image build time => cannot be adjusted at runtime
ENV API_URL_BROWSER="${API_URL_BROWSER}"
ENV APP_VERSION="${VERSION}"
ENV APP_COMMIT="${COMMIT}"
RUN npm run build-data
RUN npm run build:modern
# Second step: only install runtime dependencies
FROM docker.io/library/node:16-alpine
WORKDIR /src
ADD . .
RUN npm ci --production --no-optional
# Copy the built assets from the first step
COPY --from=builder /src/.nuxt/ ./.nuxt
COPY --from=builder /src/api/datafiles ./api/datafiles
ENV HOST="0.0.0.0"
USER node
ENTRYPOINT []
CMD ["npm", "run", "start"]
EXPOSE 3000
HEALTHCHECK CMD wget -q -O- http://localhost:3000/api/v1/health