feat: add production deployment config
- Add docker-compose.prod.yml with env var support - Add frontend/Dockerfile.prod with nginx for static serving - Fix Zulip notification to run in thread pool (avoid blocking) - Use Zulip time format for timezone-aware display - Add Zulip @mentions for users matched by email Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
34
frontend/Dockerfile.prod
Normal file
34
frontend/Dockerfile.prod
Normal file
@@ -0,0 +1,34 @@
|
||||
# Build stage
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
|
||||
COPY . .
|
||||
|
||||
# VITE_API_URL must be set at build time
|
||||
ARG VITE_API_URL
|
||||
ENV VITE_API_URL=${VITE_API_URL}
|
||||
|
||||
RUN npm run build
|
||||
|
||||
# Production stage
|
||||
FROM nginx:alpine
|
||||
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
|
||||
# Handle client-side routing
|
||||
RUN echo 'server { \
|
||||
listen 8080; \
|
||||
root /usr/share/nginx/html; \
|
||||
index index.html; \
|
||||
location / { \
|
||||
try_files $uri $uri/ /index.html; \
|
||||
} \
|
||||
}' > /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user