feat(frontend): add build script

The build script prepares the package for a production build, builds the app, places every all needed files in a dist directory and cleans it.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-08-26 14:26:47 +02:00
parent 7b3c217470
commit 4cb332622a
7 changed files with 50 additions and 26 deletions

View file

@ -26,8 +26,6 @@ ARG TURBO_TEAM
ARG TURBO_API
ARG TURBO_TOKEN
RUN rm -rf frontend/public/public
RUN rm -rf frontend/src/pages/api
RUN yarn turbo run build --filter=frontend --no-cache --no-daemon
# RUNNER
@ -43,10 +41,7 @@ LABEL org.opencontainers.image.licenses='AGPL-3.0'
WORKDIR /usr/src/app
COPY --from=builder --chown=node:node /usr/src/app/frontend/.next/standalone ./
COPY --from=builder --chown=node:node /usr/src/app/frontend/.next/static ./frontend/.next/static
COPY --from=builder /usr/src/app/frontend/next.config.js ./frontend/next.config.js
COPY --from=builder /usr/src/app/frontend/public ./frontend/public
COPY --from=builder --chown=node:node /usr/src/app/frontend/dist ./
USER node