kyobody-chatbot-api / Dockerfile
dahyedahye's picture
.
4d944df
# Use an official Python runtime as a parent image, specifically the slim version to keep the image size down
FROM python:3.11-slim
# Set the working directory to /app inside the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Create the diskcache_dir directory and grant appropriate permissions
RUN mkdir -p /app/diskcache_dir && chmod -R 777 /app/diskcache_dir
RUN mkdir -p /app/sqlite_dir && chmod -R 777 /app/sqlite_dir
RUN mkdir -p /app/chroma_dir && chmod -R 777 /app/chroma_dir
RUN chmod -R 777 /app/web
RUN touch /app/error.log /app/access.log && chmod -R 777 /app/error.log /app/access.log
# https://stackoverflow.com/questions/52535788/nltk-download-not-working-inside-docker-for-a-django-service
RUN mkdir -p /app/nltk_data/tokenizers && chmod -R 777 /app/nltk_data
ENV NLTK_DATA /app/nltk_data/
ADD . $NLTK_DATA
RUN python -m nltk.downloader punkt
# Make port 7860 available to the world outside this container
EXPOSE 7860
# Define the command to run on container start. This script starts the Flask application.
# CMD ["python", "create_sqlite_db.py"]
# CMD ["gunicorn", "-b", "0.0.0.0:7860", "rag_gpt_app:app"]
# Grant execution permissions to the start-up script
RUN chmod a+x start.sh
CMD ["./start.sh"]