diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9fa76e9 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,16 @@ +node_modules +.next +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +.env* +.DS_Store +*.log +coverage +build +dist +out +.tmp +.cache +.vscode diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..390cfc1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +# syntax=docker/dockerfile:1 + +FROM node:20-alpine AS deps +WORKDIR /app +COPY package*.json ./ +RUN npm ci --omit=dev + +FROM node:20-alpine AS builder +WORKDIR /app +COPY --from=deps /app/node_modules ./node_modules +COPY . . +RUN npm run build + +FROM node:20-alpine AS runner +WORKDIR /app +ENV NODE_ENV=production \ + NEXT_DISABLE_PWA=true + +COPY package*.json ./ +COPY --from=deps /app/node_modules ./node_modules +COPY --from=builder /app/.next ./.next +COPY --from=builder /app/public ./public + +EXPOSE 3000 +CMD ["npm", "run", "start"] diff --git a/README.md b/README.md index 5f37457..c65bad7 100644 --- a/README.md +++ b/README.md @@ -41,10 +41,30 @@ npm start This runs the PWA with the generated service worker. +### Docker deployment + +You can deploy the converter as a container on a homelab server or any Docker-capable host. + +1. Build the production image: + + ```bash + docker build -t keep-note-converter . + ``` + +2. Run the container and publish port 3000: + + ```bash + docker run -p 3000:3000 keep-note-converter + ``` + + The app is stateless, so there is no persistent storage to mount. Provide optional environment variables (e.g., `NEXT_DISABLE_PWA=true`) with `-e` flags if you want to tweak runtime behavior. Visit `http://localhost:3000` (or the server IP) to access the UI. + +3. For homelab deployments, consider running the container under a process supervisor (Docker Compose, systemd, etc.) and fronting it with a reverse proxy/HTTPS terminator if exposing it outside your LAN. + ### Next steps (internal) - [ ] Add Markdown paste support that converts directly into Keep-friendly formatting -- [ ] Provide a Docker container to deploy the app on a homelab server +- [x] Provide a Docker container to deploy the app on a homelab server - [ ] Exercise the PWA experience on a phone to validate install/offline behavior - [x] Expand the documentation with usage notes and deployment instructions - [ ] Add dark mode styling toggle for both the editor and preview