mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-04-18 20:43:55 +02:00
Reduce image size
This commit is contained in:
parent
b48eb37da2
commit
297228692c
2 changed files with 9 additions and 16 deletions
|
@ -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).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
### Changed
|
||||||
|
- Reduced image size
|
||||||
|
|
||||||
## [1.8.0] - 2022-03-24
|
## [1.8.0] - 2022-03-24
|
||||||
### Added
|
### Added
|
||||||
|
|
23
Dockerfile
23
Dockerfile
|
@ -5,36 +5,27 @@ RUN apt-get update && \
|
||||||
apt-get install -y ffmpeg && \
|
apt-get install -y ffmpeg && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
FROM base AS dependencies
|
||||||
|
|
||||||
WORKDIR /usr/app
|
WORKDIR /usr/app
|
||||||
|
|
||||||
COPY package.json .
|
COPY package.json .
|
||||||
COPY yarn.lock .
|
COPY yarn.lock .
|
||||||
|
|
||||||
# Install prod dependencies
|
|
||||||
RUN yarn install --prod
|
RUN yarn install --prod
|
||||||
|
|
||||||
# Dependencies
|
# Only keep what's necessary to run
|
||||||
FROM base AS dependencies
|
FROM base AS runner
|
||||||
|
|
||||||
# Install dev dependencies
|
WORKDIR /usr/app
|
||||||
RUN yarn install
|
|
||||||
|
|
||||||
# Build app
|
COPY --from=dependencies /usr/app/node_modules node_modules
|
||||||
FROM dependencies AS builder
|
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN yarn prisma generate
|
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
|
ARG COMMIT_HASH=unknown
|
||||||
|
|
||||||
ENV DATA_DIR /data
|
ENV DATA_DIR /data
|
||||||
|
|
Loading…
Add table
Reference in a new issue