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.8 kB · 61 lines
Dockerfile
at main
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162# Build stageFROM oven/bun:1.4.2-alpine AS build
WORKDIR /app
# Copy workspace configurationCOPY package.json tsconfig.json bun.lock* ./COPY patches ./patches
# Copy all workspace package.json files first (for dependency resolution)COPY 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 server (NODE_ENV must be set here: bun inlines process.env.NODE_ENV# reads at build time, and without it they freeze as non-production in the binary)RUN NODE_ENV=production 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"]