Central application portal with Firebase authentication.
npm install- Copy
.env.exampleto.env - Add your Firebase config values
npm run devLocal dev runs on http://localhost:4321 with native file events for fastest reload.
docker-compose.yml— DefinesdevandprodservicesDockerfile.dev— Lightweight Node container for development
Dockerfile— Added build args for FirebasePUBLIC_*env vars (required because.envis in.dockerignore)
# Local development with hot reload
docker compose up dev
# → http://localhost:4322 (for external viewers/testers)
# Production build & serve
docker compose up prod
# → http://localhost:80
# Stop a service
docker compose down dev
docker compose down prod
# Rebuild after dependency changes
docker compose build dev
# View logs
docker compose logs dev| Concern | Decision |
|---|---|
| Hot reload | Project directory mounted as volume; Astro's Vite dev server watches for changes via polling |
node_modules isolation |
Anonymous volume (/app/node_modules) prevents host node_modules from overwriting container's |
| Env vars in production | Passed as Docker build args (not via .env file) to keep secrets out of the image |
| Git workflow | Unchanged — git operations happen on the host; .git is excluded from Docker build |
| Port conflicts | Dev on 4321 (local), 4322 (Docker), prod on 80 |
npm install
npx astro dev --background- Port:
4321 - Fastest reload, native file events
- Accessible only on local machine
docker compose up dev- Port:
4322(mapped to container's4321) - Externally accessible via network IP
- Changes auto-refresh via polling
- No setup needed for testers
Astro's Vite file watcher didn't detect changes through Docker volume mounts on Windows. Fixed by enabling polling in astro.config.mjs (server.watch.usePolling: true).
Removed redundant/generated files:
| Item | Reason |
|---|---|
firebaseid.md |
Redundant — Firebase config already in .env |
dist/ |
Build artifact — gitignored, regeneratable |
.astro/ |
Astro cache — gitignored, auto-generated |
node_modules/ |
Host deps — optional when using Docker |
Add your domain to Firebase Console → Authentication → Settings → Authorized domains:
apu.zarda.my
Recommended Content-Security-Policy:
default-src 'self';
script-src 'self' 'unsafe-inline' https://apis.google.com;
style-src 'self' 'unsafe-inline';
connect-src 'self' https://*.googleapis.com https://*.firebaseio.com https://identitytoolkit.googleapis.com;
frame-src https://*.firebaseapp.com;
img-src 'self' https://*.googleapis.com https://*.gstatic.com data:;
font-src 'self' https://fonts.gstatic.com;