-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (27 loc) · 677 Bytes
/
Copy pathDockerfile
File metadata and controls
38 lines (27 loc) · 677 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
# Production Frontend Dockerfile
FROM node:18-alpine as builder
WORKDIR /app
# Install TypeScript globally
RUN npm install -g typescript
# Copy package files
COPY package*.json ./
COPY vite.config.ts ./
COPY tsconfig.json ./
# Install dependencies
RUN npm ci
# Copy source code
COPY src/ ./src/
COPY public/ ./public/
COPY index.html ./
# Build the application
RUN npm run build
# Production stage
FROM nginx:alpine
# Copy nginx configuration
COPY nginx.conf /etc/nginx/nginx.conf
# Remove default nginx config
RUN rm /etc/nginx/conf.d/default.conf
# Copy built assets
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]