add empty frontend application, prepare everything

This commit is contained in:
2022-12-27 22:31:06 +01:00
parent 802feca366
commit 2589910a11
28 changed files with 7704 additions and 825 deletions

View File

@@ -7,14 +7,14 @@ WORKDIR /opt
COPY . .
WORKDIR /opt/app
WORKDIR /opt/backend
ARG NODE_ENV=production
ENV NODE_ENV ${NODE_ENV}
RUN npm i npm@latest -g
RUN chown node:node -R /opt/app
RUN chown node:node -R /opt
USER node
# ################################################################
@@ -36,13 +36,26 @@ RUN npm install --quiet --unsafe-perm --no-progress --no-audit --include=dev
RUN npx tsc -p ./tsconfig.json
# ################################################################
# ### frontend build image ###
# ################################################################
FROM base as frontendbuild
WORKDIR /opt/frontend
RUN npm install --quiet --unsafe-perm --no-progress --no-audit --include=dev
RUN npm run build
# ################################################################
# ### production image ###
# ################################################################
FROM base as production
COPY --from=backendbuild --chown=node:node /opt/app/dist/ /opt/app/dist/
COPY --from=backendbuild --chown=node:node /opt/backend/dist/ /opt/backend/dist/
COPY --from=frontendbuild --chown=node:node /opt/frontend/dist/ /opt/frontend/dist/
RUN npm install --quiet --unsafe-perm --no-progress --no-audit --omit=dev