mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-05-10 04:01:37 +02:00
Reduce image size
This commit is contained in:
parent
b48eb37da2
commit
297228692c
2 changed files with 9 additions and 16 deletions
23
Dockerfile
23
Dockerfile
|
@ -5,36 +5,27 @@ RUN apt-get update && \
|
|||
apt-get install -y ffmpeg && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install dependencies
|
||||
FROM base AS dependencies
|
||||
|
||||
WORKDIR /usr/app
|
||||
|
||||
COPY package.json .
|
||||
COPY yarn.lock .
|
||||
|
||||
# Install prod dependencies
|
||||
RUN yarn install --prod
|
||||
|
||||
# Dependencies
|
||||
FROM base AS dependencies
|
||||
# Only keep what's necessary to run
|
||||
FROM base AS runner
|
||||
|
||||
# Install dev dependencies
|
||||
RUN yarn install
|
||||
WORKDIR /usr/app
|
||||
|
||||
# Build app
|
||||
FROM dependencies AS builder
|
||||
COPY --from=dependencies /usr/app/node_modules node_modules
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN yarn prisma generate
|
||||
|
||||
# Only copy essentials
|
||||
FROM base AS prod
|
||||
|
||||
COPY --from=builder /usr/app/src src
|
||||
COPY --from=builder /usr/app/schema.prisma .
|
||||
COPY --from=builder /usr/app/migrations migrations
|
||||
|
||||
RUN yarn prisma generate
|
||||
|
||||
ARG COMMIT_HASH=unknown
|
||||
|
||||
ENV DATA_DIR /data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue