forked from tot-ra/graphql-schema-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.CI
39 lines (33 loc) · 1.06 KB
/
Dockerfile.CI
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:14-alpine as builder-client
ARG env=production
ENV npm_config_cache=/tmp/.npm
RUN mkdir -p /tmp/.npm /app \
&& chown nobody:nobody /tmp/.npm /app
WORKDIR /app
USER nobody
ADD git_src/package.json git_src/package-lock.json ./
RUN npm install
ADD git_src/webpack.config.js git_src/babel.config.js ./
ADD git_src/client ./client
RUN npx webpack-cli --env=${env} --mode=${env}
FROM node:14-alpine as builder-app
ARG env=production
ENV npm_config_cache=/tmp/.npm
ENV NODE_ENV=${env}
RUN mkdir -p /app && chown nobody:nobody /app
COPY --from=builder-client /tmp/.npm /tmp/.npm
WORKDIR /app
ADD git_src/package.json git_src/package-lock.json ./
RUN npm install
FROM node:14-alpine
ARG env=production
ENV NODE_ENV=${env}
RUN mkdir -p /app && chown nobody:nobody /app
USER nobody
WORKDIR /app
COPY git_src/ /app
COPY --from=builder-client /app/dist /app/dist
COPY --from=builder-app /app/node_modules /app/node_modules
HEALTHCHECK --interval=10s --timeout=5s --start-period=10s --retries=3 CMD [ "node", "container-health.js" ]
EXPOSE 3000
CMD ["node", "schema-registry.js"]