feat: minimal prod compose with watchtower auto-updates

This commit is contained in:
Jonas Miederer 2026-09-07 09:05:51 +00:00
parent 338cdcf108
commit 94f353d773
4 changed files with 166 additions and 0 deletions

13
frontend/Dockerfile Normal file
View file

@ -0,0 +1,13 @@
# Production image for the React UI (build + Vite preview; internal use).
FROM node:22-slim
WORKDIR /srv/frontend
COPY package.json package-lock.json ./
RUN npm ci
COPY . ./
RUN npm run build
ENV VITE_API_PROXY_TARGET=http://app:8000
EXPOSE 3000
CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "3000"]

View file

@ -12,4 +12,14 @@ export default defineConfig({
},
},
},
preview: {
port: 3000,
proxy: {
"/api": {
// Overridable at container start (prod compose: http://app:8000).
target: process.env.VITE_API_PROXY_TARGET ?? "http://localhost:8000",
changeOrigin: true,
},
},
},
});