Update Dockerfile
This commit is contained in:
@@ -1,38 +1,7 @@
|
|||||||
worker_processes 1;
|
FROM node:18-alpine
|
||||||
|
WORKDIR /app
|
||||||
events { worker_connections 1024; }
|
COPY package*.json ./
|
||||||
|
RUN npm install --production
|
||||||
http {
|
COPY . .
|
||||||
include mime.types;
|
EXPOSE 3001
|
||||||
default_type application/octet-stream;
|
CMD ["node", "server.js"]
|
||||||
sendfile on;
|
|
||||||
keepalive_timeout 65;
|
|
||||||
|
|
||||||
# Limite upload per allegati (es. foto/video ticket)
|
|
||||||
client_max_body_size 50M;
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html;
|
|
||||||
|
|
||||||
# Compressione Gzip
|
|
||||||
gzip on;
|
|
||||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
|
||||||
|
|
||||||
# Gestione SPA (React Router)
|
|
||||||
location / {
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Proxy API verso il backend
|
|
||||||
location /api/ {
|
|
||||||
proxy_pass http://backend:3001;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection 'upgrade';
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_cache_bypass $http_upgrade;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user