Charles Grandjean commited on
Commit
b7e14c1
·
1 Parent(s): 8ec8ca7

[ush new docker

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -8
Dockerfile CHANGED
@@ -1,6 +1,5 @@
1
  FROM python:3.11-slim
2
 
3
- # Hugging Face Docker Spaces work well with UID 1000
4
  RUN useradd -m -u 1000 user
5
 
6
  ENV HOME=/home/user \
@@ -10,7 +9,6 @@ ENV HOME=/home/user \
10
 
11
  WORKDIR $HOME/app
12
 
13
- # System dependencies
14
  RUN apt-get update && apt-get install -y --no-install-recommends \
15
  bash \
16
  curl \
@@ -18,23 +16,21 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
18
  build-essential \
19
  && rm -rf /var/lib/apt/lists/*
20
 
21
- # Persistent storage mount point on HF Spaces (if enabled)
22
  RUN mkdir -p /data && chmod 777 /data
 
23
 
24
- # Install Python deps first for better layer caching
25
  COPY --chown=user requirements.txt ./requirements.txt
26
  RUN pip install --no-cache-dir --upgrade pip && \
27
  pip install --no-cache-dir -r requirements.txt
28
 
29
- # Copy application
30
  COPY --chown=user . .
31
 
32
- # Make startup script executable
33
- RUN chmod +x startup.sh
 
34
 
35
  USER user
36
 
37
- # Internal ports only; public port is controlled by README front matter
38
  EXPOSE 8000 9621 9622
39
 
40
  CMD ["./startup.sh"]
 
1
  FROM python:3.11-slim
2
 
 
3
  RUN useradd -m -u 1000 user
4
 
5
  ENV HOME=/home/user \
 
9
 
10
  WORKDIR $HOME/app
11
 
 
12
  RUN apt-get update && apt-get install -y --no-install-recommends \
13
  bash \
14
  curl \
 
16
  build-essential \
17
  && rm -rf /var/lib/apt/lists/*
18
 
 
19
  RUN mkdir -p /data && chmod 777 /data
20
+ RUN mkdir -p /home/user/app && chown -R user:user /home/user
21
 
 
22
  COPY --chown=user requirements.txt ./requirements.txt
23
  RUN pip install --no-cache-dir --upgrade pip && \
24
  pip install --no-cache-dir -r requirements.txt
25
 
 
26
  COPY --chown=user . .
27
 
28
+ RUN chmod +x startup.sh && \
29
+ touch /home/user/app/lightrag.log && \
30
+ chown user:user /home/user/app/lightrag.log
31
 
32
  USER user
33
 
 
34
  EXPOSE 8000 9621 9622
35
 
36
  CMD ["./startup.sh"]