Spaces:
Running
Running
| # Base image with Python | |
| FROM python:3.9-slim | |
| # Install necessary dependencies (including Android SDK) | |
| RUN apt-get update && apt-get install -y \ | |
| unzip \ | |
| wget \ | |
| git \ | |
| openjdk-11-jdk | |
| # Install Python dependencies | |
| COPY requirements.txt /app/ | |
| RUN pip install --no-cache-dir -r /app/requirements.txt | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy the app files | |
| COPY . /app/ | |
| # Set environment variables (if any) | |
| ENV ANDROID_SDK_ROOT=/sdk | |
| RUN mkdir -p $ANDROID_SDK_ROOT && \ | |
| cd $ANDROID_SDK_ROOT && \ | |
| wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -O cmdline-tools.zip && \ | |
| unzip cmdline-tools.zip -d cmdline-tools && \ | |
| rm cmdline-tools.zip && \ | |
| mv cmdline-tools $ANDROID_SDK_ROOT/cmdline-tools && \ | |
| yes | $ANDROID_SDK_ROOT/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} --licenses && \ | |
| $ANDROID_SDK_ROOT/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} "platform-tools" "platforms;android-33" "build-tools;33.0.2" | |
| ENV PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools | |
| # Expose the port | |
| EXPOSE 7860 | |
| # Run Gradio app | |
| CMD ["python", "app.py"] |