Add Docker deployment for Dokploy (nginx static serve)

This commit is contained in:
Nicolas Civade
2026-08-13 11:25:31 +02:00
parent c55e0751e6
commit 5c7276cf35
3 changed files with 71 additions and 0 deletions

26
Dockerfile Normal file
View File

@@ -0,0 +1,26 @@
# ---- Build stage ----
FROM node:22-alpine AS build
WORKDIR /app
# Install dependencies against the lockfile for reproducible builds
COPY package.json package-lock.json ./
RUN npm ci
# Build the static site (tsc -b && vite build -> /app/dist)
COPY . .
RUN npm run build
# ---- Serve stage ----
FROM nginx:1.27-alpine AS runtime
# SPA-aware nginx config (history fallback + asset caching)
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Static output from the build stage
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget -qO- http://localhost/ >/dev/null 2>&1 || exit 1
CMD ["nginx", "-g", "daemon off;"]