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