feat: Add full PDPA compliance with cookie consent and admin dashboard
Features implemented: - Cookie consent banner (Accept/Reject) with localStorage storage - Conditional Umami Analytics loading (only with consent) - Admin dashboard at /admin/consent-logs with password protection - API endpoints for consent logging (POST/GET/DELETE) - Updated Privacy Policy with all 14 PDPA Section 36 requirements - Updated Terms & Conditions with 17 comprehensive sections - Astro DB integration with consent logging schema - Production-ready Dockerfile with SQLite support - Start command for Easypanel deployment Files added: - src/components/consent/CookieBanner.astro - src/pages/api/consent/index.ts - src/pages/api/consent/[sessionId]/index.ts - src/pages/admin/consent-logs.astro - db/schema.ts - .env.example - PDPA-COMPLIANCE.md Files modified: - src/layouts/Layout.astro (CookieBanner + conditional Umami) - src/pages/privacy-policy.astro (full PDPA compliance) - src/pages/terms-and-conditions.astro (comprehensive update) - astro.config.mjs (Node adapter + DB) - Dockerfile (production build with DB) - package.json (dependencies + start script) Deployment notes: - CHANGE ADMIN_PASSWORD from default 'changeme' - Run with: npm run start - Docker: docker build -t moreminimore:latest .
This commit is contained in:
20
Dockerfile
20
Dockerfile
@@ -3,12 +3,26 @@ WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
# Create data directory and build with remote DB flag
|
||||
RUN mkdir -p ./data && ASTRO_DB_REMOTE_URL=file:./data/consent.db npx astro build --remote
|
||||
|
||||
FROM node:20-alpine
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci --production
|
||||
RUN npm install --production
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/db ./db
|
||||
COPY --from=builder /app/data ./data
|
||||
|
||||
# Install SQLite runtime dependencies
|
||||
RUN apk add --no-cache sqlite-libs
|
||||
|
||||
EXPOSE 80
|
||||
CMD ["npx", "serve", "dist", "-l", "80"]
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV ASTRO_DB_REMOTE_URL=file:/app/data/consent.db
|
||||
ENV HOST=0.0.0.0
|
||||
ENV PORT=80
|
||||
|
||||
# Use Node.js server entry point
|
||||
CMD ["node", "dist/server/entry.mjs"]
|
||||
|
||||
Reference in New Issue
Block a user