mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-05-14 05:01:36 +02:00
Optimize docker memory (#976)
This commit is contained in:
parent
c5f8d3373b
commit
d8d72074f2
13 changed files with 32 additions and 16 deletions
19
Dockerfile
19
Dockerfile
|
@ -14,18 +14,29 @@ COPY package.json .
|
|||
COPY yarn.lock .
|
||||
|
||||
RUN yarn install --prod
|
||||
RUN cp -R node_modules /usr/app/prod_node_modules
|
||||
|
||||
RUN yarn install
|
||||
|
||||
FROM dependencies AS builder
|
||||
|
||||
COPY . .
|
||||
|
||||
# Run tsc build
|
||||
RUN yarn prisma generate
|
||||
RUN yarn build
|
||||
|
||||
# Only keep what's necessary to run
|
||||
FROM base AS runner
|
||||
|
||||
WORKDIR /usr/app
|
||||
|
||||
COPY --from=dependencies /usr/app/node_modules node_modules
|
||||
COPY --from=builder /usr/app/dist ./dist
|
||||
COPY --from=dependencies /usr/app/prod_node_modules node_modules
|
||||
COPY --from=builder /usr/app/node_modules/.prisma/client ./node_modules/.prisma/client
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN yarn prisma generate
|
||||
|
||||
ARG COMMIT_HASH=unknown
|
||||
ARG BUILD_DATE=unknown
|
||||
|
||||
|
@ -34,4 +45,4 @@ ENV NODE_ENV production
|
|||
ENV COMMIT_HASH $COMMIT_HASH
|
||||
ENV BUILD_DATE $BUILD_DATE
|
||||
|
||||
CMD ["tini", "--", "yarn", "start"]
|
||||
CMD ["tini", "--", "node", "--enable-source-maps", "dist/scripts/migrate-and-start.js"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue