Feat: Local prod proxy
This commit is contained in:
27
Proxy/Local/Dockerfile
Normal file
27
Proxy/Local/Dockerfile
Normal file
@@ -0,0 +1,27 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
|
||||
FROM node:22-alpine AS frontend-dependencies
|
||||
|
||||
WORKDIR /workspace/Frontend
|
||||
|
||||
RUN corepack enable && corepack prepare pnpm@9.0.0 --activate
|
||||
|
||||
COPY Frontend/package.json Frontend/pnpm-lock.yaml Frontend/tsconfig.json Frontend/vite.config.ts ./
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
FROM frontend-dependencies AS frontend-build
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
COPY Frontend/ ./
|
||||
|
||||
RUN pnpm build:static
|
||||
|
||||
FROM nginx:1.29-alpine AS production
|
||||
|
||||
COPY Proxy/Local/default.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=frontend-build /workspace/Frontend/dist/client /usr/share/nginx/html
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
23
Proxy/Local/default.conf
Normal file
23
Proxy/Local/default.conf
Normal file
@@ -0,0 +1,23 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location /favicon.ico {
|
||||
try_files $uri =404;
|
||||
access_log off;
|
||||
log_not_found off;
|
||||
}
|
||||
|
||||
location /_build/ {
|
||||
access_log off;
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
try_files $uri =404;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user