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 cf84ebe456
Some checks failed
Deploy Backend / docker (ubuntu-latest) (push) Failing after 8s
Deploy Website / docker (ubuntu-latest) (push) Failing after 7s
smh my head
2024-10-22 18:29:11 +01:00

35 lines
712 B
Docker

FROM oven/bun:1.1.31-alpine AS base
# Install dependencies
FROM base AS depends
WORKDIR /app
COPY package.json bun.lockb* ./
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 projects/common ./projects/common
RUN bun i -g typescript
RUN bun --filter '@ssr/common' build
# Copy the backend project
COPY projects/backend ./projects/backend
# Lint before starting
RUN bun --filter 'backend' lint
ARG PORT=8080
ENV PORT $PORT
EXPOSE $PORT
CMD ["bun", "run", "--filter", "backend", "start"]