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

27 lines
629 B
Docker
Raw Normal View History

2024-10-08 15:39:02 +01:00
FROM oven/bun:1.1.30-alpine AS base
2024-10-08 15:32:02 +01:00
# 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
2024-10-09 01:34:34 +01:00
# Copy the depends
COPY --from=depends /app/package.json* /app/bun.lockb* ./
COPY --from=depends /app/node_modules ./node_modules
# Build the common library
2024-10-09 01:19:31 +01:00
COPY --from=depends /app/projects/common ./projects/common
2024-10-09 01:27:39 +01:00
RUN bun i -g typescript
2024-10-09 01:23:56 +01:00
RUN bun --filter '@ssr/common' build
2024-10-09 01:19:31 +01:00
2024-10-09 01:34:34 +01:00
# Copy the backend project
2024-10-08 15:32:02 +01:00
COPY --from=depends /app/projects/backend ./projects/backend
CMD ["bun", "run", "--filter", "backend", "start"]