Spaces:
Sleeping
Sleeping
File size: 1,626 Bytes
f48a3ca 15f557b f48a3ca f3dd6a4 f48a3ca f3dd6a4 19ea845 15f557b 07292ea 19ea845 15f557b f3dd6a4 19ea845 07292ea 15f557b 07292ea 026d108 f3dd6a4 026d108 f48a3ca 15f557b f48a3ca 0d2d163 f48a3ca 0d2d163 026d108 |
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
FROM python:3.9-slim
# ๋น root ์ฌ์ฉ์ ์์ฑ ๋ฐ ๊ถํ ์ค์
RUN useradd -m -u 1000 streamlit
WORKDIR /app
RUN apt-get update && apt-get install -y \
build-essential \
curl \
software-properties-common \
git \
&& rm -rf /var/lib/apt/lists/*
# 1. requirements.txt ๋ณต์ฌ (์ด ํ์ผ์๋ numpy ๊ด๋ จ ๋ผ์ธ์ด ์์)
COPY requirements.txt ./
# 2. requirements.txt์ ๋ช
์๋ ๋ชจ๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค์น
RUN pip3 install --no-cache-dir -r requirements.txt
# 3. Streamlit ์ค์ ๋๋ ํ ๋ฆฌ ์์ฑ ๋ฐ ๊ถํ ์ค์
RUN mkdir -p /home/streamlit/.streamlit && \
chown -R streamlit:streamlit /home/streamlit/.streamlit && \
chown -R streamlit:streamlit /app
# 4. NumPy ๋ฐ Pandas ํธํ์ฑ ํ์ธ
RUN python -c "import numpy; print('NumPy version:', numpy.__version__)"
RUN python -c "import pandas; print('Pandas version:', pandas.__version__)"
RUN python -c "import numpy._core; print('Successfully imported numpy._core')" || \
python -c "import numpy.core; print('Using numpy.core fallback')"
# ์ ํ๋ฆฌ์ผ์ด์
๋ฐ ๋ฐ์ดํฐ ํ์ผ ๋ณต์ฌ
COPY streamlit_app.py ./
COPY ๊ด๊ณ ์นดํผ๋ฐ์ดํฐ_๋ธ๋๋์ถ์ถ์๋ฃ.xlsx ./
COPY copy_embeddings.pkl ./
# ๋ชจ๋ ํ์ผ ๊ถํ์ streamlit ์ฌ์ฉ์์๊ฒ ํ ๋น
RUN chown -R streamlit:streamlit /app
# ๋น root ์ฌ์ฉ์๋ก ์ ํ
USER streamlit
# Streamlit ์ค์
ENV STREAMLIT_CONFIG_DIR=/home/streamlit/.streamlit
ENV HOME=/home/streamlit
EXPOSE 8501
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
ENTRYPOINT ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"] |