profil_SI / Dockerfile
noranisa's picture
Update Dockerfile
3ee7993 verified
raw
history blame contribute delete
641 Bytes
# Gunakan image Python resmi yang ringan
FROM python:3.9-slim
# Set working directory di dalam container
WORKDIR /code
# Salin file requirements dan install dependencies
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Salin seluruh kode aplikasi ke dalam container
COPY . /code
# Buat direktori untuk cache (opsional tapi baik untuk performa beberapa library)
RUN mkdir -p /.cache && chmod 777 /.cache
# Command untuk menjalankan aplikasi menggunakan Gunicorn
# Hugging Face mengharapkan aplikasi berjalan di port 7860
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]