-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathDockerfile
29 lines (26 loc) · 1.01 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
FROM --platform=linux/amd64 docker.io/node:16.19 AS dm_app_build
ARG DIRPATH=/usr/app
WORKDIR $DIRPATH
COPY ./src $DIRPATH/src
COPY package.json gruntfile.js yarn.lock tsconfig.json ./
COPY ./lib $DIRPATH/lib
COPY ./grunt-configs ./grunt-configs
# `yarn install` runs twice as a workaround for development and production
# dependencies in package.json needing better taxonomy
# NODE_ENV=production is passed here to allow for specific dev env variables when NODE_ENV=development
# @see /src/back-end/config.ts::developmentMailerConfigOptions
RUN yarn install --frozen-lockfile && \
NODE_ENV=production npm run front-end:build && \
npm run back-end:build && \
yarn install --frozen-lockfile --production && \
yarn cache clean && \
rm -Rf $DIRPATH/tmp && \
mkdir $DIRPATH/__tmp
FROM --platform=linux/amd64 docker.io/node:16.19
ARG DIRPATH=/usr/app
WORKDIR $DIRPATH
COPY --from=dm_app_build --chown=node $DIRPATH ./
RUN chmod o+w $DIRPATH/__tmp
USER node
EXPOSE 3000
CMD node build/back-end/back-end/start.js