Skip to content

feat: add Docker and Docker Compose support for self-hosting#149

Open
ethicalmohit wants to merge 2 commits into
willchen96:mainfrom
ethicalmohit:add-docker-support
Open

feat: add Docker and Docker Compose support for self-hosting#149
ethicalmohit wants to merge 2 commits into
willchen96:mainfrom
ethicalmohit:add-docker-support

Conversation

@ethicalmohit
Copy link
Copy Markdown

Summary

  • Adds backend/Dockerfile and frontend/Dockerfile for both services
  • Adds docker-compose.yml at the repo root to wire them together
  • Adds .env.example documenting the three build-time vars needed by Compose
  • Sets output: "standalone" in next.config.ts for a smaller frontend runtime image

Why

Makes self-hosting straightforward — the full stack can be built and started with a single command:

docker compose up --build

No platform-specific tooling required. The deployment still uses the existing Supabase and Cloudflare R2 infrastructure — this is purely about packaging and running the app, not replacing any services.

Changes

  • backend/Dockerfile: multi-stage build; installs LibreOffice in the runner stage (required by libreoffice-convert), compiles TypeScript and runs node dist/index.js
  • frontend/Dockerfile: multi-stage build; NEXT_PUBLIC_* vars passed as build args (baked in at build time by Next.js), copies only the standalone output for a minimal image
  • docker-compose.yml: exposes backend on 3001, frontend on 3000; frontend depends on backend; both load env from their respective .env files
  • .env.example: documents the root-level build args for Compose
  • frontend/next.config.ts: adds output: "standalone" — required for the optimized Docker image, no effect on the existing Cloudflare deployment path

Testing

Built and ran locally with both containers healthy:

  • Backend: http://localhost:3001/health returns {"ok":true}
  • Frontend: http://localhost:3000 serves the app

amal66 added a commit to amal66/mike that referenced this pull request May 25, 2026
Chapter: 27 - Self-hosting path.

Plain-English map:
Add Dockerfiles and Docker Compose configuration so contributors can run a
local web/API setup with less manual environment work.

Why it matters:
If local setup is fragile, forks drift because everyone solves deployment
differently. A supported path keeps more work shareable upstream.

Principle:
Self-hosting should be boring and documented.

Precedent borrowed:
Upstream PRs willchen96#44, willchen96#63, and willchen96#149 plus the fork report's large local/self-hosted
stack cluster.

Upstream base: willchen96/mike@d39f580.
Original local commit: b2ae01c.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant