# Use an official Python runtime as a parent image FROM python:3.10-slim # Set the working directory in the container WORKDIR /app ENV PYTHONUNBUFFERED=1 ENV GOOGLE_APPLICATION_CREDENTIALS=/app/key.json # Copy the dependencies file to the working directory COPY requirements.txt . # Install any needed packages specified in requirements.txt RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the application code to the working directory COPY . . # Make port 8080 available to the world outside this container EXPOSE 8080 # Run app.py when the container launches CMD printf "%s" "$SERVICE_ACC_KEY" > /app/key.json && gunicorn --bind 0.0.0.0:8080 --timeout 1000 --workers 4 --threads 4 --log-file - app:app