feat: Replace Next.js with Astro + PDPA compliance
- Removed Next.js, moved Astro to root - PDPA compliance: cookie consent, admin dashboard, privacy policy - Updated Dockerfile for Astro - Ready for Easypanel deployment with Nixpacks or Docker
This commit is contained in:
29
Dockerfile
29
Dockerfile
@@ -1,18 +1,13 @@
|
||||
# Astro Dockerfile (Multi-stage build)
|
||||
# Build Stage
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm ci
|
||||
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Build Next.js project
|
||||
RUN npm run build
|
||||
|
||||
# Production Stage
|
||||
@@ -20,23 +15,29 @@ FROM node:20-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install SQLite runtime
|
||||
RUN apk add --no-cache sqlite-libs
|
||||
|
||||
# Copy package files
|
||||
COPY package*.json ./
|
||||
|
||||
# Install production dependencies only
|
||||
RUN npm ci --production
|
||||
|
||||
# Copy built Next.js app
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
COPY --from=builder /app/.next/static ./.next/static
|
||||
# Copy built assets
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/astro.config.mjs ./
|
||||
|
||||
# Create data directory for database
|
||||
RUN mkdir -p /app/data
|
||||
|
||||
# Expose port
|
||||
EXPOSE 4321
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD node -e "require('http').get('http://localhost:4321', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"
|
||||
|
||||
# Start Next.js server
|
||||
CMD ["node", "server.js"]
|
||||
ENV NODE_ENV=production
|
||||
ENV ASTRO_DB_REMOTE_URL=file:/app/data/consent.db
|
||||
|
||||
# Start Astro preview server
|
||||
CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "4321"]
|
||||
|
||||
Reference in New Issue
Block a user