Spaces:
Sleeping
Sleeping
File size: 1,248 Bytes
700c673 14cd36c 7dfb4c7 c0bbedf 962e9e0 54215af 801b804 974bcb2 962e9e0 974bcb2 962e9e0 d9c409c d3a4ebc 962e9e0 a380f43 962e9e0 c25609b 974bcb2 c0bbedf 962e9e0 a07f417 54215af 1c9301c 14cd36c 54215af 66f8fc1 54215af |
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 40 |
# 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"]
|