chataii / Dockerfile
wynai's picture
Create Dockerfile
dc518f3 verified
raw
history blame contribute delete
824 Bytes
# ==== Base image ====
FROM python:3.11-slim
# (Tùy chọn) cài các gói build để tránh lỗi khi cài bcrypt,...
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential libffi-dev \
&& rm -rf /var/lib/apt/lists/*
# ==== Env ====
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
STREAMLIT_BROWSER_GATHER_USAGE_STATS=false \
STREAMLIT_SERVER_HEADLESS=true
# ==== Workdir ====
WORKDIR /app
# ==== Install deps trước để cache layer ====
COPY requirements.txt /app/requirements.txt
RUN pip install -r requirements.txt
# ==== Copy source ====
COPY . /app
# ==== Expose port ====
EXPOSE 7860
# ==== Run ====
# Streamlit sẽ bind 0.0.0.0 và port 7860
CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0", "--server.port=7860"]