Reduce image size

This commit is contained in:
Max Isom 2022-03-26 12:33:56 -04:00
parent b48eb37da2
commit 297228692c
No known key found for this signature in database
GPG key ID: 25C9B1A7F6798880
2 changed files with 9 additions and 16 deletions

View file

@ -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

View file

@ -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