From b860eb9fd820bb59099124718798386e152a49f5 Mon Sep 17 00:00:00 2001 From: frakarr Date: Tue, 9 Dec 2025 23:41:17 +0100 Subject: [PATCH] feat: Refactor Docker configurations and server logic Removes redundant Dockerfiles and configurations, consolidating them into a single set. Updates server logic for handling expense shares and notice targets to ensure correct parsing and deletion of associated records. Introduces a check for family association in the user's profile to prevent rendering payment options when a family is not assigned. --- .dockerignore | Bin 89 -> 136 bytes Dockerfile | 15 --------------- nginx.conf | 38 -------------------------------------- server/Dockerfile | 13 ------------- server/server.js | 1 + 5 files changed, 1 insertion(+), 66 deletions(-) diff --git a/.dockerignore b/.dockerignore index 21edd644e3803ddbc480cea5c66a3986704aed4a..276bbec6497998dcc0f46046911191732494e1c2 100644 GIT binary patch literal 136 zcmaFAfA9PKd*gsOOBP6k196$QE)xfkW&~m&VlV*`UO=o}2_$5I7=nu6EC?gh8A8j! Y#jB35hO;3I6nmJ|<8rux;vj?K0B1~FyZ`_I literal 89 zcmW;Eu?>JQ3`EiXcEM9*0|r1SK2SswBO4;IJ&5KPulU`ROEbMI16tyO?BxslfTVeu hFLOdIAM`0(J1rr4m6ObVyOIkP-QN;sugEA5H)O diff --git a/Dockerfile b/Dockerfile index bb87fa8..e69de29 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +0,0 @@ -# Stage 1: Build Frontend -FROM node:18-alpine as build -WORKDIR /app -COPY package*.json ./ -RUN npm install -COPY . . -RUN npm run build - -# Stage 2: Serve with Nginx -FROM nginx:alpine -COPY --from=build /app/dist /usr/share/nginx/html -# Copy the nginx configuration file (using the .txt extension as provided in source) -COPY nginx.txt /etc/nginx/nginx.conf -EXPOSE 80 -CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf index f8625d9..e69de29 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,38 +0,0 @@ -worker_processes 1; - -events { worker_connections 1024; } - -http { - include mime.types; - default_type application/octet-stream; - sendfile on; - keepalive_timeout 65; - - server { - listen 80; - root /usr/share/nginx/html; - index index.html; - - # Limite upload per allegati (es. foto/video ticket) - Allineato con il backend - client_max_body_size 50M; - - # 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; - } - } -} diff --git a/server/Dockerfile b/server/Dockerfile index 9a6d3cb..e69de29 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -1,13 +0,0 @@ -FROM node:18-alpine -WORKDIR /app - -# Set production environment -ENV NODE_ENV=production - -COPY package*.json ./ -RUN npm install --production - -COPY . . - -EXPOSE 3001 -CMD ["node", "server.js"] diff --git a/server/server.js b/server/server.js index ec9ba9a..67bdb12 100644 --- a/server/server.js +++ b/server/server.js @@ -1,3 +1,4 @@ + const express = require('express'); const cors = require('cors'); const bodyParser = require('body-parser');