# FROM python:3.12.9-alpine3.21 FROM python:3.12-slim # Set environment variables ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 # Set the working directory inside the container WORKDIR /app # Install system dependencies required for MySQL and other libraries # RUN apt-get update && apt-get install -y \ # default-libmysqlclient-dev \ # build-essential \ # && rm -rf /var/lib/apt/lists/* # Clone the Git repository RUN apt-get update RUN apt-get install -y git \ && git clone https://gitea.abdulhade.com/abdulhade/db-middleware.git . \ && apt-get remove -y git \ && apt-get autoremove -y \ && rm -rf /var/lib/apt/lists/* # Install Python dependencies RUN pip install --no-cache-dir -r files/requirements.txt # Expose port 8080 for the FastAPI application EXPOSE 8080 # Command to run the FastAPI application CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]