add empty frontend application, prepare everything
This commit is contained in:
19
Dockerfile
19
Dockerfile
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user