From 607d7ddf6f26d22a91ab132ed0cb29fe4c3290b1 Mon Sep 17 00:00:00 2001 From: Gabriella Agathon Date: Thu, 19 Feb 2026 20:37:34 -0700 Subject: [PATCH] Update image to now completely install all base-level dependencies for running the bots --- dockerfile | 52 +++++++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/dockerfile b/dockerfile index f03acc4..8be1f97 100644 --- a/dockerfile +++ b/dockerfile @@ -24,37 +24,43 @@ WORKDIR /app # Create a non-privileged user that the app will run under. # See https://docs.docker.com/go/dockerfile-user-best-practices/ ARG UID=10001 -RUN adduser \ - --disabled-password \ - --gecos "" \ - --home "/nonexistent" \ - --shell "/sbin/nologin" \ - --no-create-home \ - --uid "${UID}" \ - appuser +RUN useradd appuser -# TODO install python, pipx +# update package list +RUN apt-get update -# TODO install conda +# install wget -# TODO install poetry via pipx +# install python, pipx +RUN apt-get install -y wget python3 pipx + +# install latest conda +ENV PATH="/root/miniconda3/bin:${PATH}" +ARG PATH="/root/miniconda3/bin:${PATH}" +RUN arch=$(uname -m) && \ + if [ "$arch" = "x86_64" ]; then \ + MINICONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh"; \ + elif [ "$arch" = "aarch64" ]; then \ + MINICONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-aarch64.sh"; \ + else \ + echo "Unsupported architecture: $arch"; \ + exit 1; \ + fi && \ + wget $MINICONDA_URL -O miniconda.sh && \ + mkdir -p /root/.conda && \ + bash miniconda.sh -b -p /root/miniconda3 && \ + rm -f miniconda.sh + +# install poetry via pipx +RUN pipx install poetry # Download dependencies as a separate step to take advantage of Docker's caching. # Leverage a cache mount to /root/.cache/pip to speed up subsequent builds. # Leverage a bind mount to requirements.txt to avoid having to copy them into # into this layer. -RUN --mount=type=cache,target=/root/.cache/pip \ - --mount=type=bind,source=requirements.txt,target=requirements.txt \ - python -m pip install -r requirements.txt +# RUN --mount=type=cache,target=/root/.cache/pip \ +# --mount=type=bind,source=requirements.txt,target=requirements.txt \ +# python -m pip install -r requirements.txt # Switch to the non-privileged user to run the application. USER appuser - -# Copy the source code into the container. -COPY . . - -# Expose the port that the application listens on. -EXPOSE 8000 - -# TODO update this command statement -CMD ["python3", "src/bot_core.py", "database.ini", "discord.token", "1128111628471255050", "1441504341797371996"]