choco-conoz commited on
Commit
96bdea1
·
1 Parent(s): b9331db

feat: ch docker

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -6
Dockerfile CHANGED
@@ -1,6 +1,7 @@
1
  FROM python:3.11-slim
2
 
3
- WORKDIR /app
 
4
 
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
@@ -18,6 +19,14 @@ COPY src/ ./src/
18
  # RUN pip install -U "huggingface_hub"
19
  COPY requirements.txt ./
20
  RUN pip3 install --no-cache-dir --upgrade -r requirements.txt
 
 
 
 
 
 
 
 
21
  # COPY pyproject.toml README.md /app
22
  # RUN poetry install
23
  # RUN poetry config virtualenvs.in-project true
@@ -25,11 +34,6 @@ RUN pip3 install --no-cache-dir --upgrade -r requirements.txt
25
  # ENV VIRTUAL_ENV=/app/.venv
26
  # ENV PATH="$VIRTUAL_ENV/bin:$PATH"
27
 
28
- # RUN mkdir -p ./hf_home/
29
- # RUN chmod -R 777 ./hf_home/
30
- # RUN sh -c "export HF_HOME=/app/hf_home/"
31
- # CMD ["sh", "-c", "export HF_HOME=/app/hf_home/"]
32
-
33
  EXPOSE 8501
34
 
35
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
 
1
  FROM python:3.11-slim
2
 
3
+ WORKDIR /code
4
+ # WORKDIR /app
5
 
6
  RUN apt-get update && apt-get install -y \
7
  build-essential \
 
19
  # RUN pip install -U "huggingface_hub"
20
  COPY requirements.txt ./
21
  RUN pip3 install --no-cache-dir --upgrade -r requirements.txt
22
+
23
+ RUN useradd -m -u 1000 user
24
+ USER user
25
+ ENV HOME=/home/user \
26
+ PATH=/home/user/.local/bin:$PATH
27
+ WORKDIR $HOME/app
28
+ COPY --chown=user . $HOME/app
29
+
30
  # COPY pyproject.toml README.md /app
31
  # RUN poetry install
32
  # RUN poetry config virtualenvs.in-project true
 
34
  # ENV VIRTUAL_ENV=/app/.venv
35
  # ENV PATH="$VIRTUAL_ENV/bin:$PATH"
36
 
 
 
 
 
 
37
  EXPOSE 8501
38
 
39
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health