Add deployment files
CI / backend (push) Failing after 2m26s
CI / frontend (push) Failing after 53s

This commit is contained in:
voltsrage
2026-08-11 20:17:53 +08:00
parent a4faf7eadd
commit c871dc4842
24 changed files with 1880 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
# Build context is vigilcare-records-web/ (package.json, nginx.conf live here):
# docker build -f vigilcare-records-web/Dockerfile -t vigilcare-records-dashboard vigilcare-records-web
FROM node:22-alpine AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
# No VITE_API_URL build-arg needed: src/api/client.ts and src/api/fhirClient.ts
# use relative base URLs ("/api/v1", "/fhir") and rely on the nginx reverse proxy
# below to reach the api container at runtime — same origin in every environment.
RUN npm run build
FROM nginx:1.27-alpine AS runtime
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget -qO- http://localhost:80/ >/dev/null || exit 1
EXPOSE 80
+36
View File
@@ -0,0 +1,36 @@
# Serves the built Vue SPA and reverse-proxies API/FHIR calls to the api
# container so the frontend's relative-URL Axios clients (baseURL "/api/v1" and
# "/fhir") work unmodified in production — mirrors the Vite dev server proxy in
# vite.config.ts, just pointed at the "api" service name instead of localhost.
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
client_max_body_size 30m; # scanned document uploads (25 MB max) plus overhead
location /api/ {
proxy_pass http://api:8080;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /fhir/ {
proxy_pass http://api:8080;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# SPA history-mode fallback
location / {
try_files $uri $uri/ /index.html;
}
}