feat: Add Docker support with development and production configurations

This commit is contained in:
2025-08-04 15:56:11 +02:00
parent ec1dbaa2a7
commit 6aa0a659cc
8 changed files with 216 additions and 2 deletions

39
nginx.conf Normal file
View File

@@ -0,0 +1,39 @@
events {
worker_connections 1024;
}
http {
upstream inventory_app {
server inventory-app:3000;
}
server {
listen 80;
server_name localhost;
# Increase client max body size for file uploads
client_max_body_size 10M;
# Proxy all requests to the Next.js app
location / {
proxy_pass http://inventory_app;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
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;
proxy_cache_bypass $http_upgrade;
proxy_read_timeout 300s;
proxy_connect_timeout 75s;
}
# Optional: Serve static files directly (for better performance)
location /_next/static/ {
proxy_pass http://inventory_app;
proxy_cache_valid 1y;
add_header Cache-Control "public, immutable";
}
}
}