deepak191z commited on
Commit
9887938
·
verified ·
1 Parent(s): 3ab40d8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -19
Dockerfile CHANGED
@@ -1,28 +1,26 @@
1
- FROM node:20
 
2
 
3
- # Install git
4
- RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
5
-
6
- # Clone the repo
7
- RUN git clone https://github.com/viratxd/prompt-glow-lab-00.git /usr/src/app
8
 
9
- # Create non-root user with home directory
10
- RUN useradd -m -r -g root appuser
11
 
12
- # Set correct ownership for home and app
13
- RUN chown -R appuser:root /home/appuser /usr/src/app
14
 
15
- # Set working directory
16
- WORKDIR /usr/src/app
17
 
18
- # Switch to non-root user
19
- USER appuser
20
 
21
- # Install npm and dependencies
22
- RUN npm install -g [email protected] && npm install
23
 
24
- # Expose Vite port
25
  EXPOSE 7860
26
 
27
- # Run dev server
28
- CMD ["npm", "run", "dev"]
 
1
+ # Use Alpine Node.js image
2
+ FROM node:20-alpine
3
 
4
+ # Set working directory
5
+ WORKDIR /app
 
 
 
6
 
7
+ # Install git (needed to clone repo)
8
+ RUN apk add --no-cache git
9
 
10
+ # Clone your Vite.js app from GitHub
11
+ RUN git clone https://github.com/viratxd/prompt-glow-lab-00.git ./
12
 
13
+ # Install dependencies
14
+ RUN npm install
15
 
16
+ # Build Vite app
17
+ RUN npm run build
18
 
19
+ # Install a small static server to serve `dist/`
20
+ RUN npm install -g serve
21
 
22
+ # Expose port
23
  EXPOSE 7860
24
 
25
+ # Serve the built Vite app
26
+ CMD ["serve", "-s", "dist", "-l", "7860"]