File size: 807 Bytes
64a18a3
 
 
 
 
 
2c9e953
 
64a18a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.10

# Set the working directory inside the container
WORKDIR /ASF

# Copy the requirements file and install dependencies
COPY ./requirements.txt /asf-app/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /asf-app/requirements.txt

# Create a user and switch to it
RUN useradd user
USER user

# Set environment variables
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

# Set the working directory for the app
WORKDIR $HOME/app

# Copy the application code into the container
COPY --chown=user . $HOME/app

# Ensure the templates folder is copied (make sure it exists in your local project structure)
COPY ./templates /home/user/app/templates

# Set the command to run the FastAPI app
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--root-path", "/"]