-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
49 lines (36 loc) · 1.24 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
ARG node_version="18"
ARG node_variant="-alpine"
ARG build_version
ARG build_id
ARG build_date
FROM node:${node_version}${node_variant} as client-builder
RUN apk update \
&& apk add git
COPY ./client/ /app/client
RUN cd /app/client \
&& yarn install \
&& NODE_ENV=production yarn build \
&& rm -rf /app/client/node_modules
FROM node:${node_version}${node_variant}
ARG build_version
ARG build_id
ARG build_date
WORKDIR /app
EXPOSE 8080
HEALTHCHECK --interval=1m --timeout=20s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:${LISTEN_PORT:-8080}/${BASE_URL}/healthcheck || exit 1
CMD [ "node", "index.js" ]
COPY ./server/ /app
COPY --from=client-builder /app/client /app/client
RUN yarn install --production
# LABEL + ENV at the end to optimize layers cache during build
LABEL org.label-schema.name="Our Shopping List"
LABEL org.label-schema.vcs-url="https://github.com/nanawel/our-shopping-list"
LABEL org.label-schema.vendor="Anaël Ollier <[email protected]>"
LABEL org.label-schema.version="${build_version}#${build_id}"
LABEL org.label-schema.build-date="${build_date}"
ENV APP_ENV=production
ENV APP_VERSION=${build_version}
ENV APP_BUILD_ID=${build_id}
ENV VUE_APP_I18N_LOCALE=en
ENV VUE_APP_I18N_FALLBACK_LOCALE=en