# 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 # 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 # 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 ["python", "app/main.py"] # 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