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

35 lines
729 B
Docker
Raw Normal View History

2024-10-18 05:02:48 +00:00
FROM oven/bun:1.1.31-alpine AS base
2024-10-08 14:32:02 +00:00
# Install dependencies
FROM base AS depends
WORKDIR /app
2024-10-22 17:36:48 +00:00
COPY . .
2024-10-22 17:29:11 +00:00
RUN bun install --frozen-lockfile
2024-10-08 14:32:02 +00:00
# Run the app
FROM base AS runner
WORKDIR /app
ENV NODE_ENV production
2024-10-09 00:34:34 +00: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-22 17:36:48 +00:00
COPY --from=depends /app/projects/common ./projects/common
2024-10-09 00:27:39 +00:00
RUN bun i -g typescript
2024-10-09 00:23:56 +00:00
RUN bun --filter '@ssr/common' build
2024-10-09 00:19:31 +00:00
2024-10-09 00:34:34 +00:00
# Copy the backend project
2024-10-22 17:36:48 +00:00
COPY --from=depends /app/projects/backend ./projects/backend
2024-10-08 14:32:02 +00:00
2024-10-16 06:47:52 +00:00
# Lint before starting
2024-10-16 07:03:36 +00:00
RUN bun --filter 'backend' lint
2024-10-16 06:47:52 +00:00
2024-10-19 08:36:06 +00:00
ARG PORT=8080
ENV PORT $PORT
EXPOSE $PORT
CMD ["bun", "run", "--filter", "backend", "start"]