flood-prediction-api / Dockerfile
sephanoe's picture
Fix: Update Dockerfile to resolve PATH issue
6ecee6a
Raw
History Blame Contribute Delete
593 Bytes
# Gunakan base image Python 3.9
FROM python:3.9
# Set direktori kerja
WORKDIR /app
# Buat user non-root dan atur kepemilikan
RUN useradd -m -u 1000 user
USER user
# Tambahkan direktori bin milik user ke PATH
ENV PATH="/home/user/.local/bin:${PATH}"
# Salin dan install requirements
COPY --chown=user:user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Salin sisa file aplikasi
COPY --chown=user:user . .
# Ekspos port yang digunakan oleh Hugging Face Spaces
EXPOSE 7860
# Perintah untuk menjalankan aplikasi
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]