PhisDet / Dockerfile
RantoG's picture
Upload 2 files
37e0f3f verified
raw
history blame contribute delete
712 Bytes
FROM python:3.9
# Agar log muncul secara real-time
ENV PYTHONUNBUFFERED=1
ENV TLDEXTRACT_CACHE="/code/.tld_cache"
WORKDIR /code
# Install system dependencies needed for XGBoost/Scikit-learn
RUN apt-get update && apt-get install -y libgomp1
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Pre-download TLD list to speed up startup
RUN python -c "import tldextract; print('Updating TLD...'); tldextract.TLDExtract().update(); print('TLD Updated')"
# Copy seluruh file
COPY . /code
# Set permission agar bisa tulis database
RUN chmod -R 777 /code
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]