rastof9 commited on
Commit
32a42a9
·
verified ·
1 Parent(s): 4ae5b8c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -8
Dockerfile CHANGED
@@ -5,6 +5,15 @@ ENV FLASK_APP=app.py
5
  ENV FLASK_ENV=production
6
  ENV PATH="/home/appuser/.local/bin:$PATH"
7
 
 
 
 
 
 
 
 
 
 
8
  # Create a non-root user and set permissions
9
  RUN useradd -m appuser && mkdir -p /app /app/instance && chown -R appuser:appuser /app
10
 
@@ -13,14 +22,7 @@ USER appuser
13
 
14
  # Set the working directory
15
  WORKDIR /app
16
- # ... existing code ...
17
-
18
- # Install system dependencies for OpenCV
19
- RUN apt-get update && apt-get install -y \
20
- libgl1-mesa-glx \
21
- libglib2.0-0
22
 
23
- # ... existing code ...
24
  # Copy and install dependencies
25
  COPY --chown=appuser:appuser requirements.txt .
26
  RUN pip install --no-cache-dir -r requirements.txt
@@ -32,4 +34,4 @@ COPY --chown=appuser:appuser . .
32
  EXPOSE 5000
33
 
34
  # Run the application
35
- CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "4", "app:create_app()"]
 
5
  ENV FLASK_ENV=production
6
  ENV PATH="/home/appuser/.local/bin:$PATH"
7
 
8
+ # Install system dependencies for OpenCV and other requirements
9
+ RUN apt-get update && apt-get install -y \
10
+ libgl1-mesa-glx \
11
+ libglib2.0-0 \
12
+ libsm6 \
13
+ libxext6 \
14
+ libxrender-dev \
15
+ && rm -rf /var/lib/apt/lists/*
16
+
17
  # Create a non-root user and set permissions
18
  RUN useradd -m appuser && mkdir -p /app /app/instance && chown -R appuser:appuser /app
19
 
 
22
 
23
  # Set the working directory
24
  WORKDIR /app
 
 
 
 
 
 
25
 
 
26
  # Copy and install dependencies
27
  COPY --chown=appuser:appuser requirements.txt .
28
  RUN pip install --no-cache-dir -r requirements.txt
 
34
  EXPOSE 5000
35
 
36
  # Run the application
37
+ CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "4", "app:create_app()"]