Add nginx reverse proxy and environment configuration
- Add nginx.conf for proxying API requests to backend - Update frontend Dockerfile for production build with nginx - Move hardcoded values to .env variables in docker-compose.yml - Add .env.example template for configuration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
FROM node:20-slim
|
||||
# Build stage
|
||||
FROM node:20-slim AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files
|
||||
COPY package.json .
|
||||
|
||||
# Install dependencies
|
||||
COPY package.json package-lock.json* ./
|
||||
RUN npm install
|
||||
|
||||
# Copy source files
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# Expose port
|
||||
EXPOSE 5173
|
||||
# Production stage - just serve static files
|
||||
FROM nginx:alpine
|
||||
|
||||
# Run dev server
|
||||
CMD ["npm", "run", "dev"]
|
||||
# Copy built frontend
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
Reference in New Issue
Block a user