norhan12 commited on
Commit
008ef04
·
verified ·
1 Parent(s): 435efcf

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -7
Dockerfile CHANGED
@@ -7,16 +7,16 @@ RUN apt-get update && apt-get install -y \
7
  sox \
8
  curl \
9
  git-lfs \
10
- # --- FIX: New system dependencies for matplotlib image generation ---
11
  pkg-config \
12
  libfreetype6-dev \
13
  libpng-dev \
14
  build-essential \
15
- # --- End FIX ---
16
  && rm -rf /var/lib/apt/lists/*
 
17
  # 2. Create non-root user
18
  RUN useradd -m appuser
19
- # 3. Create directory structure (with proper ownership from the start)
 
20
  RUN mkdir -p \
21
  /tmp/matplotlib \
22
  /tmp/fontconfig \
@@ -46,9 +46,12 @@ RUN pip install --upgrade pip && \
46
  python -m spacy download en_core_web_sm && \
47
  pip check
48
 
49
- # 8. Health check
 
 
 
50
  HEALTHCHECK --interval=30s --timeout=10s \
51
- CMD curl -f http://localhost:7860/ || exit 1
52
 
53
- # 9. Run the application
54
- CMD ["python", "app.py"]
 
7
  sox \
8
  curl \
9
  git-lfs \
 
10
  pkg-config \
11
  libfreetype6-dev \
12
  libpng-dev \
13
  build-essential \
 
14
  && rm -rf /var/lib/apt/lists/*
15
+
16
  # 2. Create non-root user
17
  RUN useradd -m appuser
18
+
19
+ # 3. Create directory structure
20
  RUN mkdir -p \
21
  /tmp/matplotlib \
22
  /tmp/fontconfig \
 
46
  python -m spacy download en_core_web_sm && \
47
  pip check
48
 
49
+ # 8. Expose Flask port
50
+ EXPOSE 5000
51
+
52
+ # 9. Health check (fixed for Flask)
53
  HEALTHCHECK --interval=30s --timeout=10s \
54
+ CMD curl -f http://localhost:5000/ || exit 1
55
 
56
+ # 10. Run the application
57
+ CMD ["python", "app.py"]