Charan5775 commited on
Commit
5549d8e
·
verified ·
1 Parent(s): 40c7b15

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -7
Dockerfile CHANGED
@@ -1,22 +1,32 @@
1
- # Use official Node.js image
2
  FROM node:18-alpine
3
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
- # Install git and clone the repository
8
  RUN apk add --no-cache git && \
9
- git clone https://github.com/iib0011/omni-tools.git .
10
 
11
  # Install dependencies
12
  RUN npm install
13
 
14
- # Expose the desired port
 
 
 
 
 
 
 
 
 
 
15
  EXPOSE 8080
16
 
17
  # Set environment variables
18
- ENV PORT=8080
19
  ENV HOST=0.0.0.0
 
20
 
21
- # Run Vite dev server with external host allowed
22
- CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0", "--port", "8080", "--allowedHosts", "charan5775-testingtools.hf.space"]
 
1
+ # Use official Node.js lightweight image
2
  FROM node:18-alpine
3
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
+ # Install git and clone your repository
8
  RUN apk add --no-cache git && \
9
+ git clone https://github.com/charan200415/omni-tools.git .
10
 
11
  # Install dependencies
12
  RUN npm install
13
 
14
+ # Create vite.config.js dynamically to allow external access
15
+ RUN echo "import { defineConfig } from 'vite'; \
16
+ export default defineConfig({ \
17
+ server: { \
18
+ host: '0.0.0.0', \
19
+ port: 8080, \
20
+ allowedHosts: ['charan5775-testingtools.hf.space', 'localhost'] \
21
+ } \
22
+ });" > vite.config.js
23
+
24
+ # Expose port 8080
25
  EXPOSE 8080
26
 
27
  # Set environment variables
 
28
  ENV HOST=0.0.0.0
29
+ ENV PORT=8080
30
 
31
+ # Run Vite dev server
32
+ CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0", "--port", "8080"]