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:
25
Dockerfile
Normal file
25
Dockerfile
Normal 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"]
|
||||
Reference in New Issue
Block a user