Iwak commited on
Commit
19a805c
·
1 Parent(s): 5fb1c7e
Files changed (1) hide show
  1. Dockerfile +39 -10
Dockerfile CHANGED
@@ -1,26 +1,55 @@
1
  ARG PYTHON_VERSION=3.10.13
2
  FROM python:${PYTHON_VERSION}-slim AS base
3
 
4
- RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/*
5
-
6
- # ENV PYTHONUNBUFFERED=1
 
 
7
 
8
  ENV PORT=7860
9
 
10
- RUN ls
11
-
12
  WORKDIR /app
13
 
14
- RUN ls
 
15
 
16
- copy requirements.txt .
17
- RUN python -m pip install --upgrade pip
18
- RUN python -m pip install -r requirements.txt
19
 
 
20
  COPY . .
21
 
 
22
  EXPOSE 7860
23
 
 
24
  RUN python -V
25
 
26
- CMD sudo python -m gunicorn main:app -b 0.0.0.0:7860 -w 8 --timeout 600
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ARG PYTHON_VERSION=3.10.13
2
  FROM python:${PYTHON_VERSION}-slim AS base
3
 
4
+ # Install necessary packages including pipenv
5
+ RUN apt-get update && \
6
+ apt-get install -y \
7
+ pipenv \
8
+ && rm -rf /var/lib/apt/lists/*
9
 
10
  ENV PORT=7860
11
 
 
 
12
  WORKDIR /app
13
 
14
+ # Copy the requirements file
15
+ COPY requirements.txt .
16
 
17
+ # Install dependencies into a pipenv environment
18
+ RUN pipenv install --dev --ignore-pipfile
 
19
 
20
+ # Copy the rest of the application code
21
  COPY . .
22
 
23
+ # Expose the application port
24
  EXPOSE 7860
25
 
26
+ # Ensure Python is installed correctly
27
  RUN python -V
28
 
29
+ # Run the application using pipenv
30
+ CMD pipenv run python -m gunicorn main:app -b 0.0.0.0:7860 -w 8 --timeout 600
31
+
32
+ # ARG PYTHON_VERSION=3.10.13
33
+ # FROM python:${PYTHON_VERSION}-slim AS base
34
+
35
+ # RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/*
36
+
37
+ # ENV PORT=7860
38
+
39
+ # RUN ls
40
+
41
+ # WORKDIR /app
42
+
43
+ # RUN ls
44
+
45
+ # copy requirements.txt .
46
+ # RUN python -m pip install --upgrade pip
47
+ # RUN python -m pip install -r requirements.txt
48
+
49
+ # COPY . .
50
+
51
+ # EXPOSE 7860
52
+
53
+ # RUN python -V
54
+
55
+ # CMD sudo python -m gunicorn main:app -b 0.0.0.0:7860 -w 8 --timeout 600