Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +25 -25
Dockerfile
CHANGED
@@ -1,38 +1,38 @@
|
|
1 |
-
FROM python:3.9
|
2 |
-
|
3 |
-
RUN useradd -m -u 1000 user
|
4 |
-
USER user
|
5 |
-
ENV PATH="/home/user/.local/bin:$PATH"
|
6 |
-
|
7 |
-
WORKDIR /app
|
8 |
-
|
9 |
-
COPY --chown=user ./requirements.txt requirements.txt
|
10 |
-
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
11 |
-
|
12 |
-
COPY --chown=user . /app
|
13 |
-
# CMD ["gunicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
14 |
-
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]
|
15 |
-
|
16 |
-
|
17 |
# FROM python:3.9
|
18 |
|
19 |
-
# # Create a user for running the application
|
20 |
# RUN useradd -m -u 1000 user
|
21 |
# USER user
|
22 |
# ENV PATH="/home/user/.local/bin:$PATH"
|
23 |
|
24 |
-
# # Set the working directory for your app inside the container
|
25 |
# WORKDIR /app
|
26 |
|
27 |
-
# # Copy requirements.txt and install dependencies
|
28 |
# COPY --chown=user ./requirements.txt requirements.txt
|
29 |
# RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
30 |
|
31 |
-
# # Install Hypercorn for Quart
|
32 |
-
# RUN pip install hypercorn
|
33 |
-
|
34 |
-
# # Copy the rest of the application files into the container
|
35 |
# COPY --chown=user . /app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
-
#
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# FROM python:3.9
|
2 |
|
|
|
3 |
# RUN useradd -m -u 1000 user
|
4 |
# USER user
|
5 |
# ENV PATH="/home/user/.local/bin:$PATH"
|
6 |
|
|
|
7 |
# WORKDIR /app
|
8 |
|
|
|
9 |
# COPY --chown=user ./requirements.txt requirements.txt
|
10 |
# RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
11 |
|
|
|
|
|
|
|
|
|
12 |
# COPY --chown=user . /app
|
13 |
+
# # CMD ["gunicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
14 |
+
# CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]
|
15 |
+
|
16 |
+
|
17 |
+
FROM python:3.9
|
18 |
+
|
19 |
+
# Create a user for running the application
|
20 |
+
RUN useradd -m -u 1000 user
|
21 |
+
USER user
|
22 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
23 |
+
|
24 |
+
# Set the working directory for your app inside the container
|
25 |
+
WORKDIR /app
|
26 |
+
|
27 |
+
# Copy requirements.txt and install dependencies
|
28 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
29 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
30 |
+
|
31 |
+
# Install Hypercorn for Quart
|
32 |
+
RUN pip install hypercorn
|
33 |
+
|
34 |
+
# Copy the rest of the application files into the container
|
35 |
+
COPY --chown=user . /app
|
36 |
|
37 |
+
# Run the Quart app with Hypercorn, binding it to all interfaces on port 8000
|
38 |
+
CMD ["hypercorn", "app:app", "--bind", "0.0.0.0:8000"]
|