This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
scoresaber-reloadedv3/projects/backend/Dockerfile
Liam ff9408fb8c
All checks were successful
Deploy Backend / deploy (push) Successful in 3m31s
Deploy Website / deploy (push) Successful in 5m17s
re-add per page/leaderboard embed colors
2024-10-16 07:31:52 +01:00

41 lines
857 B
Docker

FROM oven/bun:1.1.30-alpine AS base
# Install system dependencies for node-canvas
RUN apk add --no-cache \
build-base \
cairo-dev \
pango-dev \
giflib-dev \
libjpeg-turbo-dev \
freetype-dev \
fontconfig-dev \
pixman-dev \
python3 \
pkgconfig
# Install dependencies
FROM base AS depends
WORKDIR /app
COPY . .
RUN bun install --frozen-lockfile
# Run the app
FROM base AS runner
WORKDIR /app
ENV NODE_ENV production
# Copy the depends
COPY --from=depends /app/package.json* /app/bun.lockb* ./
COPY --from=depends /app/node_modules ./node_modules
# Build the common library
COPY --from=depends /app/projects/common ./projects/common
RUN bun i -g typescript
RUN bun --filter '@ssr/common' build
# Copy the backend project
COPY --from=depends /app/projects/backend ./projects/backend
CMD ["bun", "run", "--filter", "backend", "start"]