File size: 1,048 Bytes
abd67f5
 
 
 
 
 
 
 
 
 
 
 
9893fb1
 
 
 
f578334
9893fb1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
04d660b
9893fb1
 
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
# FROM python:3.9

# RUN useradd -m -u 1000 user
# USER user
# ENV PATH="/home/user/.local/bin:$PATH"

# WORKDIR /app

# COPY --chown=user ./requirements.txt requirements.txt
# RUN pip install --no-cache-dir --upgrade -r requirements.txt

# COPY --chown=user . /app
# # CMD ["gunicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
# CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]


FROM python:3.11

# Create a user for running the application
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"

# Set the working directory for your app inside the container
WORKDIR /app

# Copy requirements.txt and install dependencies
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# Install Hypercorn for Quart
RUN pip install hypercorn

# Copy the rest of the application files into the container
COPY --chown=user . /app

# Run the Quart app with Hypercorn, binding it to all interfaces on port 8000
CMD ["hypercorn", "app:app", "--bind", "0.0.0.0:8000"]