Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +25 -17
Dockerfile
CHANGED
@@ -1,29 +1,37 @@
|
|
1 |
-
#
|
2 |
-
FROM python:3.10-slim
|
3 |
|
4 |
# Set the working directory
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
#
|
8 |
-
|
|
|
|
|
|
|
9 |
|
10 |
-
#
|
11 |
-
RUN
|
|
|
12 |
|
13 |
-
#
|
14 |
-
|
|
|
15 |
|
16 |
-
#
|
17 |
-
|
18 |
|
19 |
-
# Copy the
|
20 |
-
COPY
|
|
|
|
|
|
|
21 |
|
22 |
-
# Copy the
|
23 |
-
COPY
|
24 |
|
25 |
-
# Expose the
|
26 |
EXPOSE 7860
|
27 |
|
28 |
-
# Command to run
|
29 |
-
CMD ["
|
|
|
1 |
+
# Use the official Python image
|
2 |
+
FROM python:3.10-slim
|
3 |
|
4 |
# Set the working directory
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# Install dependencies including Wine, xvfb, and enable multiarch support
|
8 |
+
RUN dpkg --add-architecture i386 && \
|
9 |
+
apt-get update && \
|
10 |
+
apt-get install -y wine wget wine32 curl xvfb && \
|
11 |
+
rm -rf /var/lib/apt/lists/*
|
12 |
|
13 |
+
# Create necessary directories and set permissions
|
14 |
+
RUN mkdir uploads compiled && \
|
15 |
+
chmod -R 777 uploads compiled
|
16 |
|
17 |
+
# Download and install Inno Setup
|
18 |
+
RUN wget -O is.exe "https://files.jrsoftware.org/is/6/innosetup-6.3.3.exe" && \
|
19 |
+
xvfb-run wine is.exe /SILENT
|
20 |
|
21 |
+
# Initialize Wine configuration
|
22 |
+
RUN xvfb-run winecfg
|
23 |
|
24 |
+
# Copy the requirements file
|
25 |
+
COPY ./requirements.txt /app/requirements.txt
|
26 |
+
|
27 |
+
# Install Python dependencies
|
28 |
+
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
|
29 |
|
30 |
+
# Copy the Flask app files
|
31 |
+
COPY . .
|
32 |
|
33 |
+
# Expose the port the app runs on
|
34 |
EXPOSE 7860
|
35 |
|
36 |
+
# Command to run the Flask app
|
37 |
+
CMD ["sh", "-c", "Xvfb :99 -screen 0 1024x768x24 & python main.py"]
|