fix: update Dockerfile for production deployment

This commit is contained in:
2026-04-21 23:22:02 +02:00
parent 58921ca65b
commit 802e50378f
2 changed files with 9 additions and 5 deletions

View File

@@ -1,11 +1,15 @@
# Stage 1 — deps + build
FROM oven/bun:1 AS builder
# Stage 1 — install deps & build
FROM oven/bun:1.2 AS builder
WORKDIR /app
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile
RUN bun install
COPY . .
ARG STRAPI_URL=https://strapi.moshariri.com
ENV STRAPI_URL=$STRAPI_URL
RUN bun run build
# Stage 2 — production runtime
@@ -15,7 +19,6 @@ WORKDIR /app
COPY --from=builder /app/.output ./.output
EXPOSE 3000
ENV NODE_ENV=production
CMD ["node", ".output/server/index.mjs"]

View File

@@ -8,6 +8,7 @@
"scripts": {
"dev": "vite dev --port 3000",
"build": "vite build",
"start": "node .output/server/index.mjs",
"preview": "vite preview",
"test": "vitest run",
"lint": "eslint",
@@ -53,4 +54,4 @@
"lightningcss"
]
}
}
}