28 lines
905 B
Docker
28 lines
905 B
Docker
FROM docker.io/library/python:3.12-slim AS base
|
|
|
|
WORKDIR /app
|
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
# SSH tools for mobile build orchestration (SSH to build host, docker exec into flutter-build container)
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
sshpass openssh-client \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY . .
|
|
|
|
# GeoLite2 City database for IP geolocation
|
|
# Download from https://dev.maxmind.com/geoip/geolite2-free-geolocation-data
|
|
# and place at backend/geo/GeoLite2-City.mmdb before building
|
|
RUN mkdir -p /app/geo
|
|
COPY geo/ /app/geo/
|
|
|
|
# Ensure upload/artifact dirs exist at runtime
|
|
RUN mkdir -p /tmp/kmtn_mobile_build_uploads /tmp/kmtn_mobile_build_artifacts
|
|
|
|
EXPOSE 8000
|
|
CMD ["gunicorn", "app.main:app", "-k", "uvicorn.workers.UvicornWorker", "-b", "0.0.0.0:8000", "--workers", "1", "--timeout", "120"]
|