fix: serve static files in production

- Added static file serving in Express for production
- Added SPA fallback for client-side routing
- Created Dockerfile with NODE_ENV=production
- Frontend now properly served at dash.descomplicar.pt

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-04 23:43:36 +00:00
parent 75f29ee6d5
commit 4af01c0f36
3 changed files with 52 additions and 0 deletions

25
Dockerfile Normal file
View File

@@ -0,0 +1,25 @@
FROM node:22-alpine
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install ALL dependencies (needed for build)
RUN npm ci
# Copy source
COPY . .
# Build frontend and API
RUN npm run build
# Set production environment
ENV NODE_ENV=production
ENV API_PORT=3001
# Expose port
EXPOSE 3001
# Start command (serves API + static frontend)
CMD ["npm", "start"]