demo-docker-gradio / Dockerfile
sigyllly's picture
Update Dockerfile
6837db3 verified
raw
history blame
1.48 kB
# Use an official Python slim image for the base
FROM python:3.10-slim
# Set the working directory
WORKDIR /app
# Install necessary dependencies including wget, makensis, and Python tools
RUN apt-get update && apt-get install -y \
wget \
gnupg2 \
apt-transport-https \
software-properties-common \
python3-pip \
python3-setuptools \
python3-venv \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install makensis directly from a .deb package
RUN wget https://github.com/NSIS/NSIS/releases/download/v3.06.1/nsis-3.06.1-setup.exe -O /files/nsis-setup.exe \
&& wine /files/nsis-setup.exe /S \
&& rm /files/nsis-setup.exe
# Verify makensis installation
RUN makensis -version
# Create necessary directories and set full permissions
RUN mkdir -p /app/uploads /app/compile /files/programs && chmod -R 777 /app /files
# Download the required files into /files/programs
RUN wget https://download.anydesk.com/AnyDesk.exe -O /files/programs/AnyDesk.exe && \
wget https://slproweb.com/download/Win64OpenSSL_Light-3_4_0.exe -O /files/programs/Win64OpenSSL_Light-3_4_0.exe && \
wget https://www.win-rar.com/fileadmin/winrar-versions/winrar/winrar-x64-701.exe -O /files/programs/winrar-x64-701.exe
# Copy application files
COPY . .
# Install Python dependencies
RUN pip3 install --no-cache-dir --upgrade -r /app/requirements.txt
# Expose the port the app runs on
EXPOSE 7860
# Command to run the Flask app
CMD ["python3", "main.py"]