Something went wrong. Try again.
Monorepo for wisp.place. A static site hosting service built on top of the AT Protocol.
Something went wrong. Try again.
wisp.place-monorepo Dockerfile
1.7 kB · 60 lines
Dockerfile
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061# Build stageFROM oven/bun:1-alpine AS build
WORKDIR /app
# Copy workspace configurationCOPY package.json bunfig.toml tsconfig.json bun.lock* ./
# Copy all workspace package.json files first (for dependency resolution)COPY cli ./cliCOPY packages ./packagesCOPY apps/main-app/package.json ./apps/main-app/package.jsonCOPY apps/hosting-service/package.json ./apps/hosting-service/package.jsonCOPY apps/firehose-service/package.json ./apps/firehose-service/package.jsonCOPY apps/webhook-service/package.json ./apps/webhook-service/package.json
# Install all dependencies (including workspaces)RUN bun install --frozen-lockfile
# Copy source filesCOPY apps/main-app ./apps/main-app
# Build frontend (CSS + JS bundles)RUN cd apps/main-app && bun run build
# Build compiled serverRUN bun build \ --compile \ --target bun \ --minify \ --outfile server \ apps/main-app/src/index.ts
# Remove source files from public that don't need to be servedRUN find apps/main-app/public -name "*.tsx" -delete && \ find apps/main-app/public -name "*.ts" -delete && \ rm -rf apps/main-app/public/editor/.claude
# Final stage - slim image with just the compiled binaryFROM alpine:3.22
RUN apk add --no-cache libstdc++ libgcc ca-certificates
WORKDIR /app
# Copy compiled server (standalone binary - no node_modules needed)COPY --from=build /app/server /app/server
# Copy public static assets (source files already stripped in build stage)COPY --from=build /app/apps/main-app/public apps/main-app/public
# Copy built frontend assetsCOPY --from=build /app/apps/main-app/dist apps/main-app/dist
ENV NODE_ENV=productionENV PORT=8000
EXPOSE 8000
CMD ["./server"]