k22056537 commited on
Commit
241eb23
·
1 Parent(s): 8eeba10

fix: resolve LFS at build time via git lfs pull

Browse files

Include .git in Docker context so git lfs pull can convert pointers
to real files. Restored model download steps from original Dockerfile.

Files changed (2) hide show
  1. .dockerignore +0 -5
  2. Dockerfile +16 -2
.dockerignore CHANGED
@@ -1,4 +1,3 @@
1
- .git
2
  node_modules
3
  dist
4
  __pycache__
@@ -7,8 +6,4 @@ __pycache__
7
  .venv
8
  data/
9
  *.db
10
- .gitattributes
11
- .gitignore
12
  .eslintrc*
13
- *.md
14
- !README.md
 
 
1
  node_modules
2
  dist
3
  __pycache__
 
6
  .venv
7
  data/
8
  *.db
 
 
9
  .eslintrc*
 
 
Dockerfile CHANGED
@@ -11,7 +11,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
11
  libglib2.0-0 libsm6 libxrender1 libxext6 libxcb1 libgl1 libgomp1 \
12
  ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev \
13
  libavdevice-dev libopus-dev libvpx-dev libsrtp2-dev \
14
- build-essential git curl \
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
  RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu
@@ -21,11 +21,25 @@ RUN pip install --no-cache-dir -r requirements.txt
21
 
22
  COPY . .
23
 
 
 
 
 
 
 
24
  ENV FOCUSGUARD_CACHE_DIR=/app/.cache/focusguard
 
 
 
 
 
 
 
 
25
 
26
  RUN mkdir -p /app/data /app/.cache && chown -R user:user /app
27
 
28
  USER user
29
  EXPOSE 7860
30
 
31
- CMD ["bash", "start.sh"]
 
11
  libglib2.0-0 libsm6 libxrender1 libxext6 libxcb1 libgl1 libgomp1 \
12
  ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev \
13
  libavdevice-dev libopus-dev libvpx-dev libsrtp2-dev \
14
+ build-essential git git-lfs curl \
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
  RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu
 
21
 
22
  COPY . .
23
 
24
+ # Resolve LFS pointers to real binary files, then drop .git
25
+ RUN git lfs install && \
26
+ git lfs pull && \
27
+ rm -rf .git
28
+
29
+ # Download face_mesh model (non-fatal if network blocked)
30
  ENV FOCUSGUARD_CACHE_DIR=/app/.cache/focusguard
31
+ RUN python -c "\
32
+ try:\
33
+ from models.face_mesh import _ensure_model; _ensure_model(); print('face_mesh model cached')\
34
+ except Exception as e:\
35
+ print(f'face_mesh pre-download skipped: {e}')\
36
+ "
37
+
38
+ RUN python download_l2cs_weights.py || echo "[WARN] L2CS weights skipped"
39
 
40
  RUN mkdir -p /app/data /app/.cache && chown -R user:user /app
41
 
42
  USER user
43
  EXPOSE 7860
44
 
45
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--log-level", "info"]