2026-07-10 23:00:41 +02:00
|
|
|
FROM docker.io/node:22-alpine AS build
|
2026-07-10 22:42:23 +02:00
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
COPY frontend/package.json ./
|
|
|
|
|
RUN npm install
|
|
|
|
|
|
|
|
|
|
COPY frontend/ .
|
|
|
|
|
RUN npm run build
|
|
|
|
|
|
2026-07-10 23:00:41 +02:00
|
|
|
FROM docker.io/nginx:1.27-alpine
|
2026-07-10 22:42:23 +02:00
|
|
|
|
|
|
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
|
|
|
|
|
|
|
|
|
COPY <<'EOF' /etc/nginx/conf.d/default.conf
|
|
|
|
|
server {
|
|
|
|
|
listen 80;
|
|
|
|
|
server_name _;
|
|
|
|
|
|
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
|
index index.html;
|
|
|
|
|
|
|
|
|
|
location / {
|
|
|
|
|
try_files $uri $uri/ /index.html;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location /api/ {
|
|
|
|
|
proxy_pass http://api:8000;
|
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
EXPOSE 80
|
|
|
|
|
|
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|