forked from safe-global/safe-client-gateway
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
30 lines (26 loc) · 861 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
#
# BUILD CONTAINER
#
FROM node:18.17 as base
ENV NODE_ENV production
WORKDIR /app
COPY --chown=node:node .yarn/releases ./.yarn/releases
COPY --chown=node:node .yarn/plugins ./.yarn/plugins
COPY --chown=node:node package.json yarn.lock .yarnrc.yml tsconfig*.json ./
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn workspaces focus --production
COPY --chown=node:node assets ./assets
COPY --chown=node:node src ./src
RUN yarn run build
#
# PRODUCTION CONTAINER
#
FROM node:18.17-alpine as production
USER node
ARG VERSION
ARG BUILD_NUMBER
ENV APPLICATION_VERSION=${VERSION} \
APPLICATION_BUILD_NUMBER=${BUILD_NUMBER}
COPY --chown=node:node --from=base /app/node_modules ./node_modules
COPY --chown=node:node --from=base /app/dist ./dist
COPY --chown=node:node --from=base /app/assets ./assets
CMD [ "node", "dist/main.js" ]