# Dockerfile

# The first instruction is what image we want to base our container on
# We Use an official Python runtime as a parent image
FROM python:3.11.5

# copy and mount application code to image
RUN mkdir -p /code
VOLUME /data:/code
RUN chmod -R 777 /code/
COPY . code
WORKDIR /code
RUN chmod -R 777 /code/

ENV HF_HOME=/code/.huggingface

# Allows docker to cache installed dependencies between builds
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
# add --no-cache-dir as a parameter to install requirements without using cache

EXPOSE 7860
# CMD ["/launch.sh"]

# runs the production server
ENTRYPOINT ["python", "mysite/manage.py"]
CMD ["runserver", "0.0.0.0:7860"]
