discord-bot-nlp/docker/Dockerfile

39 lines
970 B
Text
Raw Normal View History

2025-07-09 13:03:05 +10:00
FROM ubuntu:25.10
# Pip is really freaking annoying now.
# We'll install venv. Install all modules into the venv using the entrypoint.
# Basics to run
RUN apt update && apt -y install python3 python3-pip
# Required for voice support
RUN apt update && apt -y install libffi-dev libnacl-dev python3-dev python3.13-venv
# Create workdir
RUN mkdir -p /app
WORKDIR /app
# Create venv
RUN python3 -m venv /venv
RUN chown -R ubuntu:ubuntu /venv
# Upload entrypoint
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN chown ubuntu:ubuntu /entrypoint.sh
# Pre-install requirements
COPY requirements.txt /requirements.txt
RUN chown ubuntu:ubuntu /requirements.txt
# Ubuntu comes loaded with the ubuntu user (id 1000) so just use that.
USER ubuntu
# Install requirements and spacy core
RUN /venv/bin/pip install -r /requirements.txt
RUN /venv/bin/python -m spacy download en_core_web_sm
ENTRYPOINT ["/entrypoint.sh"]