Add Dockerfile and compose setup for self-hosting
Multi-stage build: Node builds the static PWA, nginx serves it with an SPA fallback, long-lived caching for hashed assets, no-cache for the app shell and service worker, and the correct type for the web manifest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VsorPV3JeJRoZ1mD1pdvtL
This commit is contained in:
parent
08a530c78f
commit
23d0c29e0b
5 changed files with 72 additions and 0 deletions
14
Dockerfile
Normal file
14
Dockerfile
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# Build the static PWA, then serve it with nginx.
|
||||
|
||||
FROM node:24-alpine AS build
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:1.29-alpine
|
||||
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=build /app/build /usr/share/nginx/html
|
||||
EXPOSE 80
|
||||
HEALTHCHECK --interval=30s --timeout=3s CMD wget -qO /dev/null http://127.0.0.1/ || exit 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue