Spaces:
Sleeping
Sleeping
# Use the official Python image | |
FROM python:3.10-slim | |
# Set the working directory | |
WORKDIR /app | |
# Install dependencies including Wine, xvfb, and enable multiarch support | |
RUN dpkg --add-architecture i386 && \ | |
apt-get update && \ | |
apt-get install -y wine wget wine32 curl xvfb && \ | |
rm -rf /var/lib/apt/lists/* | |
# Create necessary directories and set permissions | |
RUN mkdir uploads compiled && \ | |
chmod -R 777 uploads compiled | |
# Download and install Inno Setup | |
RUN wget -O is.exe "https://files.jrsoftware.org/is/6/innosetup-6.3.3.exe" && \ | |
xvfb-run wine is.exe /SILENT | |
# Initialize Wine configuration | |
RUN xvfb-run winecfg | |
# Copy the requirements file | |
COPY ./requirements.txt /app/requirements.txt | |
# Install Python dependencies | |
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt | |
# Copy the Flask app files | |
COPY . . | |
# Expose the port the app runs on | |
EXPOSE 7860 | |
# Command to run the Flask app | |
CMD ["sh", "-c", "Xvfb :99 -screen 0 1024x768x24 & python main.py"] | |