Unmeshraj commited on
Commit
8a58070
·
1 Parent(s): 634f5f4
Files changed (2) hide show
  1. .gitignore +15 -0
  2. Dockerfile +0 -9
.gitignore ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ venv/
2
+ __pycache__/
3
+ *.pyc
4
+ *.pyo
5
+ *.pyd
6
+ .Python
7
+ *.egg-info/
8
+ dist/
9
+ build/
10
+ .env
11
+ .vscode/
12
+ .idea/
13
+ *.log
14
+ dataset/
15
+ .DS_Store
Dockerfile CHANGED
@@ -1,35 +1,26 @@
1
- # Use a slim Python image
2
  FROM python:3.11-slim
3
 
4
- # Set environment variables
5
  ENV PYTHONUNBUFFERED=1
6
  ENV PORT=7860
7
  ENV HOME=/home/user
8
 
9
- # Install system dependencies as root
10
  RUN apt-get update && apt-get install -y \
11
  libgl1 \
12
  libglib2.0-0 \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
- # Create a non-root user
16
  RUN useradd -m -u 1000 user
17
  USER user
18
  ENV PATH="/home/user/.local/bin:$PATH"
19
 
20
- # Set working directory
21
  WORKDIR /app
22
 
23
- # Copy requirements and install
24
  COPY --chown=user requirements.txt .
25
  RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
26
  pip install --no-cache-dir -r requirements.txt
27
 
28
- # Copy the application code
29
  COPY --chown=user . .
30
 
31
- # Expose the port (Hugging Face default is 7860)
32
  EXPOSE 7860
33
 
34
- # Run the application with Gunicorn
35
  CMD ["sh", "-c", "gunicorn -b 0.0.0.0:$PORT --timeout 120 app:app"]
 
 
1
  FROM python:3.11-slim
2
 
 
3
  ENV PYTHONUNBUFFERED=1
4
  ENV PORT=7860
5
  ENV HOME=/home/user
6
 
 
7
  RUN apt-get update && apt-get install -y \
8
  libgl1 \
9
  libglib2.0-0 \
10
  && rm -rf /var/lib/apt/lists/*
11
 
 
12
  RUN useradd -m -u 1000 user
13
  USER user
14
  ENV PATH="/home/user/.local/bin:$PATH"
15
 
 
16
  WORKDIR /app
17
 
 
18
  COPY --chown=user requirements.txt .
19
  RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
20
  pip install --no-cache-dir -r requirements.txt
21
 
 
22
  COPY --chown=user . .
23
 
 
24
  EXPOSE 7860
25
 
 
26
  CMD ["sh", "-c", "gunicorn -b 0.0.0.0:$PORT --timeout 120 app:app"]