File size: 590 Bytes
c81c458 28abf3d 6262276 c81c458 6262276 c81c458 |
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 |
FROM python:3.9-slim
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV TZ=Asia/Shanghai
WORKDIR /app
# Install git
RUN apt-get update && apt-get install -y git
# Clone the repository
RUN git clone https://github.com/Chenyme/oaifree-tools.git .
# Create a non-root user
RUN useradd -m myuser
# Create log directory and set ownership
RUN mkdir -p /app/config && chown -R myuser:myuser /app
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# 暴露容器端口
EXPOSE 8501
# Switch to non-root user
USER myuser
CMD ["streamlit", "run", "/app/home.py"] |