# Use a base image with the necessary tools FROM ubuntu:20.04 # Set environment variables to non-interactive mode ENV DEBIAN_FRONTEND=noninteractive WORKDIR /app # Install necessary packages RUN apt-get update && \ apt-get install -y \ curl \ gnupg \ python3 \ python3-pip \ libpq-dev \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Download and install skopeo RUN curl -fsSL https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/Release.key | gpg --dearmor -o /usr/share/keyrings/libcontainers-archive-keyring.gpg \ && echo "deb [signed-by=/usr/share/keyrings/libcontainers-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list \ && apt-get update \ && apt-get install -y skopeo \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* RUN useradd -m -u 1000 user # Install FastAPI and Uvicorn RUN pip3 install fastapi uvicorn COPY --chown=user . /app CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]