EricaLuvGemma commited on
Commit
9a1e7ea
·
verified ·
1 Parent(s): 5b3b8d2

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -14
Dockerfile CHANGED
@@ -1,33 +1,36 @@
1
- # TreyOS — HuggingFace Spaces + Docker Image
 
2
  FROM python:3.12-slim
3
 
 
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
  curl procps \
 
 
 
 
 
6
  && rm -rf /var/lib/apt/lists/*
7
 
8
- WORKDIR /trey
9
 
10
- # Install dependencies
11
  COPY backend/requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
- # Copy directories cleanly
 
 
 
15
  COPY backend/ ./backend/
16
  COPY frontend/ ./frontend/
17
 
18
- # Also copy your main index file directly to root if your backend points to it there
19
- COPY TreyOS-connected.html .
20
-
21
- ENV TREY_ROOT=/workspace
22
  ENV PORT=7860
23
 
24
  EXPOSE 7860
25
 
26
- # Point healthcheck explicitly to the api route if root is empty initially
27
- HEALTHCHECK --interval=30s --timeout=5s \
28
- CMD curl -f http://localhost:7860/health || exit 1
29
-
30
- # Explicitly declare PYTHONPATH so python reliably resolves the backend submodule
31
- ENV PYTHONPATH=/trey
32
 
33
  CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # TreyOS — HuggingFace Spaces Docker Image
2
+
3
  FROM python:3.12-slim
4
 
5
+ # System deps + Chromium deps for Playwright
6
  RUN apt-get update && apt-get install -y --no-install-recommends \
7
  curl procps \
8
+ # Chromium / Playwright deps
9
+ libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \
10
+ libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \
11
+ libgbm1 libasound2 libpango-1.0-0 libpangocairo-1.0-0 \
12
+ libgtk-3-0 libx11-xcb1 libxcb-dri3-0 \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
+ WORKDIR /app
16
 
17
+ # Python deps
18
  COPY backend/requirements.txt .
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
21
+ # Install Playwright Chromium browser
22
+ RUN playwright install chromium
23
+
24
+ # App files
25
  COPY backend/ ./backend/
26
  COPY frontend/ ./frontend/
27
 
28
+ ENV TREY_ROOT=/app
 
 
 
29
  ENV PORT=7860
30
 
31
  EXPOSE 7860
32
 
33
+ HEALTHCHECK --interval=30s --timeout=10s \
34
+ CMD curl -f http://localhost:7860/api/health || exit 1
 
 
 
 
35
 
36
  CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"]