refactor: switch to nginx for serving static files and remove Node.js dependencies
Some checks failed
Deploy / deploy (push) Failing after 25s
Some checks failed
Deploy / deploy (push) Failing after 25s
This commit is contained in:
parent
5bb63bacf5
commit
e69443ea2e
2 changed files with 4 additions and 22 deletions
|
|
@ -14,22 +14,10 @@ COPY . .
|
|||
RUN npm run build
|
||||
|
||||
|
||||
FROM node:22-bookworm-slim AS runtime
|
||||
FROM nginx:alpine AS runtime
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV ASTRO_TELEMETRY_DISABLED=1
|
||||
ENV HOST=0.0.0.0
|
||||
ENV PORT=4321
|
||||
EXPOSE 80
|
||||
|
||||
COPY --from=build --chown=node:node /app/package.json ./package.json
|
||||
COPY --from=build --chown=node:node /app/package-lock.json ./package-lock.json
|
||||
COPY --from=build --chown=node:node /app/node_modules ./node_modules
|
||||
COPY --from=build --chown=node:node /app/dist ./dist
|
||||
|
||||
USER node
|
||||
|
||||
EXPOSE 4321
|
||||
|
||||
CMD ["node", "dist/server/entry.mjs"]
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue