Spaces:
Build error
Build error
| # Base image (Android SDK 33 pre-installed) | |
| FROM cirrusci/android-sdk:33 | |
| # Root user for environment setup | |
| USER root | |
| # 1. Update & Install Tools | |
| RUN apt-get update && \ | |
| apt-get install -y python3 python3-pip openjdk-17-jdk apksigner zipalign && \ | |
| apt-get clean && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # 2. Environment Variables | |
| ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-amd64 | |
| ENV ANDROID_HOME /opt/android-sdk | |
| ENV PATH ${PATH}:${JAVA_HOME}/bin | |
| # Working Directory | |
| WORKDIR /app | |
| # Requirements Copy | |
| COPY requirements.txt . | |
| # Install Flask and dependencies | |
| RUN pip3 install --no-cache-dir flask | |
| RUN pip3 install --no-cache-dir -r requirements.txt | |
| # Files Copy | |
| COPY . . | |
| # CRUCIAL PERMISSIONS: Giving write access to both App and Android SDK folders! | |
| RUN chmod -R 777 /app | |
| RUN chmod -R 777 /opt/android-sdk | |
| # Port Expose | |
| EXPOSE 7860 | |
| # Run Command | |
| CMD ["python3", "app.py"] |