# Use a base image with Python 3.10 or higher FROM tiangolo/uvicorn-gunicorn-fastapi:python3.10-slim # install git RUN apt-get update && apt-get install -y git # need to force reinstall because of dependeincies RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir fastapi uvicorn && \ pip install --no-cache-dir --upgrade --force-reinstall opentrons && \ pip install --no-cache-dir --force-reinstall opentrons-hardware@git+https://github.com/Opentrons/opentrons@release#subdirectory=hardware && \ pip list RUN useradd -m -u 1000 user USER root # Create the 'storage' directory with root permissions RUN mkdir /app/storage # Change ownership of the 'storage' directory to the 'user' user RUN chown -R user:user /app/storage USER user COPY --chmod=765 ./app /app CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]