mirror of
https://github.com/BluemediaGER/muse.git
synced 2024-11-23 01:05:30 +01:00
Reduce image size
This commit is contained in:
parent
b48eb37da2
commit
297228692c
|
@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
### Changed
|
||||
- Reduced image size
|
||||
|
||||
## [1.8.0] - 2022-03-24
|
||||
### Added
|
||||
|
|
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…
Reference in a new issue