forked from vancehuds/VanceFeedback
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.frontend
More file actions
38 lines (27 loc) · 755 Bytes
/
Dockerfile.frontend
File metadata and controls
38 lines (27 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Frontend Dockerfile for VanceFeedback
# This builds the React application and serves it with Nginx
# Build Stage
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files and configs
COPY package*.json ./
COPY vite.config.js ./
COPY tailwind.config.js ./
COPY postcss.config.js ./
COPY index.html ./
# Copy source code
COPY src/ ./src/
# Install all dependencies (including devDependencies for build)
RUN npm install
# Build the frontend
RUN npm run build
# Production Stage
FROM nginx:alpine
# Copy built files from builder
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose frontend port
EXPOSE 3020
# Start nginx
CMD ["nginx", "-g", "daemon off;"]