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