Files
portfolio/Dockerfile

26 lines
497 B
Docker

# Stage 1 — install deps & build
FROM oven/bun:1.2 AS builder
WORKDIR /app
COPY package.json bun.lock ./
RUN bun install
COPY . .
ARG STRAPI_URL=https://strapi.moshariri.com
ENV STRAPI_URL=$STRAPI_URL
ENV NODE_ENV=production
RUN set -e && bun run build && echo "Build output:" && ls -la dist/server/
# Stage 2 — production runtime
FROM node:22-alpine AS runner
WORKDIR /app
COPY --from=builder /app/dist ./dist
EXPOSE 3000
ENV NODE_ENV=production
CMD ["node", "dist/server/server.js"]