///
Browse files- Dockerfile +39 -10
Dockerfile
CHANGED
@@ -1,25 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
FROM python:3.10-slim
|
2 |
|
3 |
# Install g++
|
4 |
RUN apt-get update && apt-get install -y g++
|
5 |
|
6 |
-
# "Handling Permission
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
# ENV HOME=/home/user \
|
11 |
-
# PATH=/home/user/.local/bin:$PATH
|
12 |
-
|
13 |
|
14 |
-
|
15 |
-
|
16 |
|
|
|
17 |
|
|
|
|
|
18 |
|
19 |
# For GPU support:
|
20 |
RUN pip3 install --extra-index-url https://download.pytorch.org/whl/cu118 torch torchvision
|
21 |
|
22 |
RUN pip install -r requirements.txt
|
23 |
|
|
|
|
|
24 |
|
25 |
-
CMD fastapi run --reload --host=0.0.0.0 --port=7860
|
|
|
1 |
+
# FROM python:3.10-slim
|
2 |
+
|
3 |
+
# # Install g++
|
4 |
+
# RUN apt-get update && apt-get install -y g++
|
5 |
+
|
6 |
+
# # "Handling Permission dennied Error"
|
7 |
+
# # RUN useradd user
|
8 |
+
# # USER user
|
9 |
+
|
10 |
+
# # ENV HOME=/home/user \
|
11 |
+
# # PATH=/home/user/.local/bin:$PATH
|
12 |
+
|
13 |
+
|
14 |
+
# # WORKDIR /app
|
15 |
+
# # COPY --chown=user ./ $HOME/app
|
16 |
+
|
17 |
+
|
18 |
+
|
19 |
+
# # For GPU support:
|
20 |
+
# RUN pip3 install --extra-index-url https://download.pytorch.org/whl/cu118 torch torchvision
|
21 |
+
|
22 |
+
# RUN pip install -r requirements.txt
|
23 |
+
|
24 |
+
|
25 |
+
# CMD fastapi run --reload --host=0.0.0.0 --port=7860
|
26 |
+
|
27 |
+
|
28 |
+
|
29 |
FROM python:3.10-slim
|
30 |
|
31 |
# Install g++
|
32 |
RUN apt-get update && apt-get install -y g++
|
33 |
|
34 |
+
# "Handling Permission denied Error"
|
35 |
+
RUN useradd user
|
36 |
+
USER user
|
|
|
|
|
|
|
|
|
37 |
|
38 |
+
ENV HOME=/app \
|
39 |
+
PATH=/app/.local/bin:$PATH
|
40 |
|
41 |
+
WORKDIR /app
|
42 |
|
43 |
+
# Copy requirements file
|
44 |
+
COPY requirements.txt .
|
45 |
|
46 |
# For GPU support:
|
47 |
RUN pip3 install --extra-index-url https://download.pytorch.org/whl/cu118 torch torchvision
|
48 |
|
49 |
RUN pip install -r requirements.txt
|
50 |
|
51 |
+
# Copy application code
|
52 |
+
COPY . .
|
53 |
|
54 |
+
CMD fastapi run --reload --host=0.0.0.0 --port=7860
|