nami0342 commited on
Commit
a0bcc0b
ยท
1 Parent(s): 979d308

Change path and file dir

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -7
Dockerfile CHANGED
@@ -1,8 +1,11 @@
1
  FROM python:3.10.9
2
 
3
- COPY . .
4
 
5
- WORKDIR /
 
 
 
 
6
 
7
  # Hugging Face ์บ์‹œ ๋””๋ ‰ํ† ๋ฆฌ ์„ค์ • ๋ฐ ์ƒ์„ฑ (HF_HOME ๊ณ ๋ ค)
8
  ENV TRANSFORMERS_CACHE=/tmp/huggingface_cache
@@ -14,15 +17,18 @@ ENV MPLCONFIGDIR=/tmp/matplotlib_cache
14
  RUN mkdir -p /tmp/matplotlib_cache
15
 
16
  # ์‚ฌ์šฉ์ž ์ƒ์„ฑ ๋ฐ ์†Œ์œ ์ž ๋ณ€๊ฒฝ
17
- RUN adduser --uid 1000 myuser
18
- RUN chown -R myuser:myuser /tmp/huggingface_cache /tmp/huggingface_home /tmp/matplotlib_cache
 
 
 
19
 
20
  # OpenGL ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์„ค์น˜ (opencv-python ์„ค์น˜ ์ „์—)
21
  RUN apt-get update && apt-get install -y libgl1
22
 
23
- # ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์‹คํ–‰ ์‚ฌ์šฉ์ž ๋ณ€๊ฒฝ
24
- USER myuser
 
25
 
26
- RUN pip install --no-cache-dir --upgrade -r /requirements.txt
27
 
28
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.10.9
2
 
 
3
 
4
+ WORKDIR /code
5
+
6
+ COPY ./requirements.txt /code/requirements.txt
7
+
8
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
9
 
10
  # Hugging Face ์บ์‹œ ๋””๋ ‰ํ† ๋ฆฌ ์„ค์ • ๋ฐ ์ƒ์„ฑ (HF_HOME ๊ณ ๋ ค)
11
  ENV TRANSFORMERS_CACHE=/tmp/huggingface_cache
 
17
  RUN mkdir -p /tmp/matplotlib_cache
18
 
19
  # ์‚ฌ์šฉ์ž ์ƒ์„ฑ ๋ฐ ์†Œ์œ ์ž ๋ณ€๊ฒฝ
20
+ RUN adduser --uid 1000 user
21
+
22
+ USER user
23
+
24
+ RUN chown -R user:user /tmp/huggingface_cache /tmp/huggingface_home /tmp/matplotlib_cache
25
 
26
  # OpenGL ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์„ค์น˜ (opencv-python ์„ค์น˜ ์ „์—)
27
  RUN apt-get update && apt-get install -y libgl1
28
 
29
+ WORKDIR $HOME/app
30
+
31
+ COPY --chown=user . $HOME/app
32
 
 
33
 
34
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]