File size: 1,144 Bytes
791cd9d
9b2ffea
 
791cd9d
9b2ffea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
791cd9d
9b2ffea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
791cd9d
9b2ffea
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

# 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"]