fix: update Dockerfile for production deployment
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -1,11 +1,15 @@
|
|||||||
# Stage 1 — deps + build
|
# Stage 1 — install deps & build
|
||||||
FROM oven/bun:1 AS builder
|
FROM oven/bun:1.2 AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package.json bun.lock ./
|
COPY package.json bun.lock ./
|
||||||
RUN bun install --frozen-lockfile
|
RUN bun install
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
ARG STRAPI_URL=https://strapi.moshariri.com
|
||||||
|
ENV STRAPI_URL=$STRAPI_URL
|
||||||
|
|
||||||
RUN bun run build
|
RUN bun run build
|
||||||
|
|
||||||
# Stage 2 — production runtime
|
# Stage 2 — production runtime
|
||||||
@@ -15,7 +19,6 @@ WORKDIR /app
|
|||||||
COPY --from=builder /app/.output ./.output
|
COPY --from=builder /app/.output ./.output
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
CMD ["node", ".output/server/index.mjs"]
|
CMD ["node", ".output/server/index.mjs"]
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev --port 3000",
|
"dev": "vite dev --port 3000",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
|
"start": "node .output/server/index.mjs",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"lint": "eslint",
|
"lint": "eslint",
|
||||||
@@ -53,4 +54,4 @@
|
|||||||
"lightningcss"
|
"lightningcss"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user