Rename Dockerfile.txt to Dockerfile

#1
by Rakshitjan - opened
Files changed (2) hide show
  1. Dockerfile +37 -0
  2. Dockerfile.txt +0 -22
Dockerfile ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # FROM python:3.9-slim
2
+
3
+ # WORKDIR /app
4
+
5
+ # # Install system dependencies
6
+ # RUN apt-get update && apt-get install -y \
7
+ # build-essential \
8
+ # && rm -rf /var/lib/apt/lists/*
9
+
10
+ # # Copy and install requirements
11
+ # COPY requirements.txt .
12
+ # RUN pip install --no-cache-dir -r requirements.txt
13
+
14
+ # # Copy application files
15
+ # COPY . .
16
+
17
+ # # Expose ports for both FastAPI and Gradio
18
+ # EXPOSE 7860
19
+ # EXPOSE 8000
20
+
21
+ # # Run the combined application
22
+ # CMD ["python", "app.py"]
23
+
24
+
25
+ FROM python:3.9
26
+
27
+ RUN useradd -m -u 1000 user
28
+ USER user
29
+ ENV PATH="/home/user/.local/bin:$PATH"
30
+
31
+ WORKDIR /app
32
+
33
+ COPY --chown=user ./requirements.txt requirements.txt
34
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
35
+
36
+ COPY --chown=user . /app
37
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
Dockerfile.txt DELETED
@@ -1,22 +0,0 @@
1
- FROM python:3.9-slim
2
-
3
- WORKDIR /app
4
-
5
- # Install system dependencies
6
- RUN apt-get update && apt-get install -y \
7
- build-essential \
8
- && rm -rf /var/lib/apt/lists/*
9
-
10
- # Copy and install requirements
11
- COPY requirements.txt .
12
- RUN pip install --no-cache-dir -r requirements.txt
13
-
14
- # Copy application files
15
- COPY . .
16
-
17
- # Expose ports for both FastAPI and Gradio
18
- EXPOSE 7860
19
- EXPOSE 8000
20
-
21
- # Run the combined application
22
- CMD ["python", "app.py"]