feat: add Easypanel persistent volume support for Astro DB
- Change Dockerfile from nginx (static) to Node.js (SSR) - Add @astrojs/node adapter for SSR mode - Add OUT_DIR=/data for persistent SQLite storage - Add .env.example with persistent storage config - Update README with Easypanel deployment instructions - Database persists across redeployments at /data/astro.db
This commit is contained in:
@@ -3,17 +3,23 @@ FROM node:20-alpine AS builder
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:alpine AS runner
|
||||
FROM node:20-alpine AS runner
|
||||
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
WORKDIR /app
|
||||
RUN mkdir -p /data
|
||||
|
||||
EXPOSE 80
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/package.json ./
|
||||
RUN npm install --omit=dev
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
ENV HOST=0.0.0.0
|
||||
ENV PORT=4321
|
||||
ENV NODE_ENV=production
|
||||
|
||||
EXPOSE 4321
|
||||
|
||||
CMD ["node", "dist/server/entry.mjs"]
|
||||
Reference in New Issue
Block a user