Spaces:
Sleeping
Sleeping
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"] |