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/website/Dockerfile

39 lines
816 B
Docker
Raw Normal View History

2024-10-21 21:03:02 +00:00
FROM oven/bun:1.1.32-alpine AS base
2024-10-04 21:07:09 +01:00
2024-10-09 01:17:00 +01:00
# Install dependencies
FROM base AS depends
WORKDIR /app
COPY . .
RUN bun install --frozen-lockfile
2024-10-04 20:35:44 +01:00
2024-10-09 01:17:00 +01:00
# Run the app
2024-10-04 21:39:39 +01:00
FROM base AS runner
2024-10-04 20:35:44 +01:00
WORKDIR /app
2024-10-09 01:17:00 +01:00
# Set the environment
ENV NODE_ENV production
2024-10-04 21:23:47 +01:00
ARG GIT_REV
ENV GIT_REV=${GIT_REV}
2024-10-09 01:54:07 +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:41 +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:41 +01:00
2024-10-09 01:54:07 +01:00
# Copy the website project
2024-10-09 01:17:00 +01:00
COPY --from=depends /app/projects/website ./projects/website
# Build the website
RUN bun run --filter website build
2024-10-04 20:35:44 +01:00
2024-10-09 01:17:00 +01:00
# Expose the app port
2024-10-04 20:35:44 +01:00
EXPOSE 3000
ENV HOSTNAME="0.0.0.0"
ENV PORT=3000
2024-10-09 01:58:42 +01:00
CMD ["bun", "run", "--filter", "website", "start"]