sudo-soldier commited on
Commit
e8e4b26
·
verified ·
1 Parent(s): e93c08a

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +48 -0
Dockerfile ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a base image with Python and Node.js
2
+ FROM python:3.9-slim
3
+
4
+ # Install required dependencies
5
+ RUN apt-get update && apt-get install -y \
6
+ openjdk-8-jdk \
7
+ wget \
8
+ curl \
9
+ unzip \
10
+ git \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Install Node.js (for Bubblewrap CLI)
14
+ RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - \
15
+ && apt-get install -y nodejs \
16
+ && npm install -g create-bubblewrap
17
+
18
+ # Install Android SDK (required for Bubblewrap)
19
+ RUN mkdir /sdk && cd /sdk && \
20
+ wget https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip && \
21
+ unzip commandlinetools-linux-7583922_latest.zip && \
22
+ rm commandlinetools-linux-7583922_latest.zip
23
+
24
+ # Set environment variables for the Android SDK
25
+ ENV ANDROID_HOME=/sdk
26
+ ENV PATH=$ANDROID_HOME/cmdline-tools/bin:$PATH
27
+
28
+ # Accept the licenses for the Android SDK
29
+ RUN yes | sdkmanager --licenses
30
+
31
+ # Install necessary Android SDK packages
32
+ RUN sdkmanager "platform-tools" "build-tools;30.0.3" "platforms;android-30"
33
+
34
+ # Set the working directory to /app
35
+ WORKDIR /app
36
+
37
+ # Install Python dependencies (e.g., Flask)
38
+ COPY requirements.txt /app
39
+ RUN pip install -r requirements.txt
40
+
41
+ # Copy the Python script and other necessary files into the container
42
+ COPY . /app
43
+
44
+ # Expose the port that the Flask app will run on
45
+ EXPOSE 7860
46
+
47
+ # Run the Flask app when the container starts
48
+ CMD ["python", "app.py"]