Iwak commited on
Commit
e3ae6a4
·
1 Parent(s): 223356f
Files changed (1) hide show
  1. Dockerfile +58 -52
Dockerfile CHANGED
@@ -1,52 +1,58 @@
1
- ===== Application Startup at 2024-08-19 12:31:43 =====
2
-
3
- Traceback (most recent call last):
4
- File "/usr/bin/pipenv", line 33, in <module>
5
- sys.exit(load_entry_point('pipenv==2022.12.19', 'console_scripts', 'pipenv')())
6
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7
- File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 1128, in __call__
8
- return self.main(*args, **kwargs)
9
- ^^^^^^^^^^^^^^^^^^^^^^^^^^
10
- File "/usr/lib/python3/dist-packages/pipenv/cli/options.py", line 57, in main
11
- return super().main(*args, **kwargs, windows_expand_args=False)
12
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13
- File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 1053, in main
14
- rv = self.invoke(ctx)
15
- ^^^^^^^^^^^^^^^^
16
- File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 1659, in invoke
17
- return _process_result(sub_ctx.command.invoke(sub_ctx))
18
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19
- File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 1395, in invoke
20
- return ctx.invoke(self.callback, **ctx.params)
21
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22
- File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 754, in invoke
23
- return __callback(*args, **kwargs)
24
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
25
- File "/usr/lib/python3/dist-packages/pipenv/vendor/click/decorators.py", line 84, in new_func
26
- return ctx.invoke(f, obj, *args, **kwargs)
27
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28
- File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 754, in invoke
29
- return __callback(*args, **kwargs)
30
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
31
- File "/usr/lib/python3/dist-packages/pipenv/cli/command.py", line 424, in run
32
- do_run(
33
- File "/usr/lib/python3/dist-packages/pipenv/core.py", line 2807, in do_run
34
- ensure_project(
35
- File "/usr/lib/python3/dist-packages/pipenv/core.py", line 533, in ensure_project
36
- if project.s.PIPENV_USE_SYSTEM or project.virtualenv_exists:
37
- ^^^^^^^^^^^^^^^^^^^^^^^^^
38
- File "/usr/lib/python3/dist-packages/pipenv/project.py", line 217, in virtualenv_exists
39
- if os.path.exists(self.virtualenv_location):
40
- ^^^^^^^^^^^^^^^^^^^^^^^^
41
- File "/usr/lib/python3/dist-packages/pipenv/project.py", line 414, in virtualenv_location
42
- self._virtualenv_location = self.get_location_for_virtualenv()
43
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44
- File "/usr/lib/python3/dist-packages/pipenv/project.py", line 239, in get_location_for_virtualenv
45
- return str(get_workon_home().joinpath(self.virtualenv_name))
46
- ^^^^^^^^^^^^^^^^^
47
- File "/usr/lib/python3/dist-packages/pipenv/utils/shell.py", line 202, in get_workon_home
48
- os.makedirs(expanded_path, exist_ok=True)
49
- File "<frozen os>", line 215, in makedirs
50
- File "<frozen os>", line 215, in makedirs
51
- File "<frozen os>", line 225, in makedirs
52
- PermissionError: [Errno 13] Permission denied: '/.local'
 
 
 
 
 
 
 
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