demo-docker-gradio / Dockerfile
sigyllly's picture
Update Dockerfile
962e9e0 verified
raw
history blame
1.25 kB
# Use an official Python slim image for the base
FROM python:3.10-slim
# Set the working directory
WORKDIR /app
# Install dependencies: wget, gnupg2, unzip, and mono
RUN apt-get update && apt-get install -y \
wget \
gnupg2 \
apt-transport-https \
software-properties-common \
&& wget https://download.mono-project.com/repo/xamarin.gpg -O /etc/apt/trusted.gpg.d/xamarin.asc \
&& echo "deb https://download.mono-project.com/repo/debian stable-buster main" > /etc/apt/sources.list.d/mono-official-stable.list \
&& apt-get update \
&& apt-get install -y mono-complete \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set environment variables for Mono
ENV PATH=$PATH:/usr/bin/mono:/usr/lib/mono
# Verify installations and Mono compiler
RUN mono --version && mcs --version && echo $PATH
# Install Python pip and other dependencies
RUN apt-get install -y python3-pip && pip3 install --no-cache-dir --upgrade -r /app/requirements.txt
# Create necessary directories and set permissions for all folders
RUN mkdir -p /app/uploads /app/compile && chmod -R 777 /app
# Copy the Flask app files
COPY . .
# Expose the port the app runs on
EXPOSE 7860
# Command to run the Flask app
CMD ["python3", "main.py"]