shashwatIDR commited on
Commit
c6a6502
·
verified ·
1 Parent(s): 4584969

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -21
Dockerfile CHANGED
@@ -1,31 +1,20 @@
1
- # Use the official Node.js runtime as the base image
2
- FROM node:18-alpine
3
 
4
- # Set the working directory in the container
5
  WORKDIR /app
6
 
7
- # Copy package.json and package-lock.json (if available)
8
- COPY package*.json ./
9
-
10
- # Install dependencies - use npm install if package-lock.json doesn't exist
11
- RUN npm install --omit=dev
12
-
13
- # Copy the rest of the application code
14
  COPY . .
15
 
16
- # Create a non-root user to run the app
17
- RUN addgroup -g 1001 -S nodejs
18
- RUN adduser -S nextjs -u 1001
19
-
20
- # Change ownership of the app directory to the nodejs user
21
- RUN chown -R nextjs:nodejs /app
22
- USER nextjs
23
 
24
- # Expose the port the app runs on
25
  EXPOSE 7860
26
 
27
- # Define environment variable for the port (HF Spaces uses 7860)
28
  ENV PORT=7860
29
 
30
- # Start the application
31
- CMD ["npm", "start"]
 
1
+ # Use official lightweight Python image
2
+ FROM python:3.11-slim
3
 
4
+ # Set the working directory
5
  WORKDIR /app
6
 
7
+ # Copy requirements directly (you can also use a requirements.txt file instead)
 
 
 
 
 
 
8
  COPY . .
9
 
10
+ # Install dependencies
11
+ RUN pip install --no-cache-dir Flask requests sse-starlette httpx
 
 
 
 
 
12
 
13
+ # Expose the port (e.g., 7860 for HF Spaces or your desired one)
14
  EXPOSE 7860
15
 
16
+ # Environment variable (optional)
17
  ENV PORT=7860
18
 
19
+ # Start the Python app
20
+ CMD ["python", "app.py"]