- 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>
26 lines
372 B
Docker
26 lines
372 B
Docker
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"]
|