fix: update Dockerfile for production deployment
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -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"]
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user