Files
moreminimore-website/Dockerfile
Kunthawat Greethong 7552b875e9 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 .
2026-03-10 12:59:17 +07:00

29 lines
684 B
Docker

FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
# 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 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
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"]