chore: update dockerfile

This commit is contained in:
dec0dOS 2023-10-04 21:20:20 +01:00
parent 69d4d2288f
commit e88c95454e
2 changed files with 17 additions and 14 deletions

View file

@ -3,7 +3,9 @@
*Dockerfile*
*docker-compose*
node_modules
jsconfig.js
jsconfig.json
tsconfig.json
.eslintrc.json
.DS_Store
tmp
temp
@ -13,4 +15,5 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
.yarn/cache
backend/data/db.json

View file

@ -1,30 +1,30 @@
FROM --platform=$BUILDPLATFORM node:lts-alpine as frontend-build
ENV INLINE_RUNTIME_CHUNK=false
ENV GENERATE_SOURCEMAP=false
WORKDIR /app/frontend
COPY yarn.lock .yarnrc.yml ./
COPY .yarn/ ./.yarn/
COPY ./frontend/package*.json /app/frontend
RUN yarn install
COPY ./frontend /app/frontend
WORKDIR /app/
COPY --link package.json yarn.lock* .yarnrc.yml ./
COPY --link .yarn/ ./.yarn
COPY --link ./frontend/package.json /app/frontend
RUN yarn workspaces focus frontend
COPY --link ./frontend /app/frontend
WORKDIR /app/frontend
RUN yarn build
FROM node:lts-alpine
WORKDIR /app/frontend/build
COPY --from=frontend-build /app/frontend/build /app/frontend/build/
COPY --link --from=frontend-build /app/frontend/build /app/frontend/build/
WORKDIR /app/backend
COPY yarn.lock .yarnrc.yml ./
COPY .yarn/ ./.yarn/
COPY ./backend/package*.json /app/backend
RUN yarn install
COPY --link package.json yarn.lock* .yarnrc.yml ./
COPY --link .yarn/ ./.yarn
COPY --link ./backend/package.json /app/backend
RUN yarn workspaces focus --production backend && yarn cache clean
COPY ./backend /app/backend
COPY --link ./backend /app/backend
EXPOSE 4000
ENV NODE_ENV=production