sigyllly commited on
Commit
bd9ffae
·
verified ·
1 Parent(s): 45a1acf

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -17
Dockerfile CHANGED
@@ -1,29 +1,37 @@
1
- # Stage 1: Use the official Python image to install dependencies
2
- FROM python:3.10-slim as builder
3
 
4
  # Set the working directory
5
  WORKDIR /app
6
 
7
- # Copy the requirements file
8
- COPY requirements.txt .
 
 
 
9
 
10
- # Install Python dependencies
11
- RUN pip install --no-cache-dir -r requirements.txt
 
12
 
13
- # Stage 2: Use the Inno Setup Docker image
14
- FROM amake/innosetup:latest
 
15
 
16
- # Set the working directory
17
- WORKDIR /app
18
 
19
- # Copy the Flask app files from the builder stage
20
- COPY --from=builder /app /app
 
 
 
21
 
22
- # Copy the main.py file
23
- COPY main.py .
24
 
25
- # Expose the necessary port
26
  EXPOSE 7860
27
 
28
- # Command to run your Flask app
29
- CMD ["python", "main.py"]
 
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"]