File size: 1,207 Bytes
e13455c
 
 
 
59371b3
e13455c
 
 
 
e0568c1
e13455c
 
 
 
 
 
 
 
59371b3
 
 
 
 
 
 
 
e13455c
 
59371b3
e13455c
 
 
 
 
dc43c61
e13455c
 
 
 
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
# Choose our version of Python
FROM python:3.9-slim

# Set up a working directory
# WORKDIR /code


# Copy just the requirements into the working directory so it gets cached by itself
COPY ./requirements.txt /code/requirements.txt
RUN apt-get update && apt-get install -y ffmpeg

# Install the dependencies from the requirements file
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

# RUN pip install pydantic==1.10.8
# RUN pip install typing-inspect==0.8.0 typing_extensions==4.5.
# RUN pip install --force-reinstall typing-extensions==4.5
# RUN pip install --force-reinstall openai==1.8
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH

WORKDIR $HOME/code

COPY --chown=user ./app $HOME/code/app

# Copy the code into the working directory
# COPY ./app /code/app

ENV PORT=8000
EXPOSE 8000

# execute the command python main.py (in the WORKDIR) to start the app
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]

# Tell uvicorn to start spin up our code, which will be running inside the container now
# CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
# uvicorn app.main:app --host 0.0.0.0 --port 80