Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +26 -7
Dockerfile
CHANGED
@@ -1,4 +1,7 @@
|
|
1 |
FROM python:3.9-slim
|
|
|
|
|
|
|
2 |
WORKDIR /app
|
3 |
|
4 |
RUN apt-get update && apt-get install -y \
|
@@ -11,17 +14,23 @@ RUN apt-get update && apt-get install -y \
|
|
11 |
# 1. requirements.txt ๋ณต์ฌ (์ด ํ์ผ์๋ numpy ๊ด๋ จ ๋ผ์ธ์ด ์์)
|
12 |
COPY requirements.txt ./
|
13 |
|
14 |
-
# 2.
|
15 |
-
RUN pip3 install --no-cache-dir
|
|
|
|
|
|
|
16 |
|
17 |
-
# 3.
|
18 |
-
RUN pip3 install --no-cache-dir
|
19 |
|
20 |
-
# 4.
|
21 |
-
RUN
|
|
|
|
|
22 |
|
23 |
-
# 5. NumPy
|
24 |
RUN python -c "import numpy; print('NumPy version:', numpy.__version__)"
|
|
|
25 |
RUN python -c "import numpy._core; print('Successfully imported numpy._core')" || \
|
26 |
python -c "import numpy.core; print('Using numpy.core fallback')"
|
27 |
|
@@ -30,6 +39,16 @@ COPY streamlit_app.py ./
|
|
30 |
COPY ๊ด๊ณ ์นดํผ๋ฐ์ดํฐ_๋ธ๋๋์ถ์ถ์๋ฃ.xlsx ./
|
31 |
COPY copy_embeddings.pkl ./
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
EXPOSE 8501
|
34 |
|
35 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
|
|
1 |
FROM python:3.9-slim
|
2 |
+
|
3 |
+
# ๋น root ์ฌ์ฉ์ ์์ฑ ๋ฐ ๊ถํ ์ค์
|
4 |
+
RUN useradd -m -u 1000 streamlit
|
5 |
WORKDIR /app
|
6 |
|
7 |
RUN apt-get update && apt-get install -y \
|
|
|
14 |
# 1. requirements.txt ๋ณต์ฌ (์ด ํ์ผ์๋ numpy ๊ด๋ จ ๋ผ์ธ์ด ์์)
|
15 |
COPY requirements.txt ./
|
16 |
|
17 |
+
# 2. ํธํ๋๋ ํจํค์ง ๋ฒ์ ๋ค์ ๋ชจ๋ ํจ๊ป ์ค์น
|
18 |
+
RUN pip3 install --no-cache-dir \
|
19 |
+
"numpy>=2.0.0" \
|
20 |
+
"pandas>=2.0.0" \
|
21 |
+
"streamlit>=1.35.0"
|
22 |
|
23 |
+
# 3. ๋๋จธ์ง requirements.txt์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ค ์ค์น
|
24 |
+
RUN pip3 install --no-cache-dir -r requirements.txt
|
25 |
|
26 |
+
# 4. Streamlit ์ค์ ๋๋ ํ ๋ฆฌ ์์ฑ ๋ฐ ๊ถํ ์ค์
|
27 |
+
RUN mkdir -p /home/streamlit/.streamlit && \
|
28 |
+
chown -R streamlit:streamlit /home/streamlit/.streamlit && \
|
29 |
+
chown -R streamlit:streamlit /app
|
30 |
|
31 |
+
# 5. NumPy ํธํ์ฑ ํ์ธ
|
32 |
RUN python -c "import numpy; print('NumPy version:', numpy.__version__)"
|
33 |
+
RUN python -c "import pandas; print('Pandas version:', pandas.__version__)"
|
34 |
RUN python -c "import numpy._core; print('Successfully imported numpy._core')" || \
|
35 |
python -c "import numpy.core; print('Using numpy.core fallback')"
|
36 |
|
|
|
39 |
COPY ๊ด๊ณ ์นดํผ๋ฐ์ดํฐ_๋ธ๋๋์ถ์ถ์๋ฃ.xlsx ./
|
40 |
COPY copy_embeddings.pkl ./
|
41 |
|
42 |
+
# ๋ชจ๋ ํ์ผ ๊ถํ์ streamlit ์ฌ์ฉ์์๊ฒ ํ ๋น
|
43 |
+
RUN chown -R streamlit:streamlit /app
|
44 |
+
|
45 |
+
# ๋น root ์ฌ์ฉ์๋ก ์ ํ
|
46 |
+
USER streamlit
|
47 |
+
|
48 |
+
# Streamlit ์ค์
|
49 |
+
ENV STREAMLIT_CONFIG_DIR=/home/streamlit/.streamlit
|
50 |
+
ENV HOME=/home/streamlit
|
51 |
+
|
52 |
EXPOSE 8501
|
53 |
|
54 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|