File size: 707 Bytes
43bc104
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
30
31
FROM python:3.10

RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH

# Set the working directory
WORKDIR $HOME/app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN git config --global credential.helper store

COPY . .
COPY supervisord.conf .

# Set permissions on the log file
USER root
RUN touch $HOME/app/mylog.log $HOME/app/supervisord.log && chmod a+rwx $HOME/app/mylog.log $HOME/app/supervisord.log

RUN mkdir -p /tmp/cache/
RUN mkdir -p /.cache
RUN chmod a+rwx -R /tmp/cache/
RUN chmod a+rwx -R /.cache
ENV HF_HUB_CACHE=HF_HOME

ENV PYTHONUNBUFFERED=1 PORT=7860

# Run supervisord
CMD ["supervisord", "-c", "supervisord.conf"]