File size: 742 Bytes
17c9b97
2e8cb50
10bf571
 
 
7a796bc
ac071f7
10bf571
 
 
 
 
7a796bc
 
10bf571
 
67ab40f
 
10bf571
 
 
 
 
 
 
7a796bc
 
10bf571
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM python:3.10-slim

# Deps système
RUN apt-get update && apt-get install -y --no-install-recommends \
    git ca-certificates && \
    rm -rf /var/lib/apt/lists/*

# User 'user' (comme HF)
RUN useradd -m -u 1000 user || true
USER user

# Confort Python
ENV PIP_NO_CACHE_DIR=1 PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1

# Install deps Python
COPY --chown=user:user requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt

# Workspace
ENV WORKSPACE=/home/user/workspace
WORKDIR ${WORKSPACE}

# Entrypoint = script qui clone + lance uvicorn
COPY --chown=user:user entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh

EXPOSE 7860
CMD ["/usr/local/bin/entrypoint.sh"]