31 lines
686 B
Docker
31 lines
686 B
Docker
FROM oven/bun:1.1.31-alpine AS base
|
|
|
|
# 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
|
|
|
|
# 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 --from=depends /app/projects/common ./projects/common
|
|
RUN bun i -g typescript
|
|
RUN bun --filter '@ssr/common' build
|
|
|
|
# Copy the backend project
|
|
COPY --from=depends /app/projects/backend ./projects/backend
|
|
|
|
# Lint before starting
|
|
RUN bun --filter 'backend' lint
|
|
|
|
CMD ["bun", "run", "--filter", "backend", "start"]
|