Skip to content

Commit

Permalink
Update to Debian 12 and OpenJDK 17
Browse files Browse the repository at this point in the history
Still Python 3.11, don't worry
  • Loading branch information
PhasecoreX committed Jul 9, 2024
1 parent 35409e0 commit 4d741d0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 46 deletions.
66 changes: 23 additions & 43 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11-slim-bullseye as core-build
FROM python:3.11-slim-bookworm AS core-build

# Add PhasecoreX user-entrypoint script
ADD https://raw.githubusercontent.com/PhasecoreX/docker-user-image/master/user-entrypoint.sh /bin/user-entrypoint
Expand Down Expand Up @@ -32,27 +32,24 @@ RUN set -eux; \

VOLUME /data

ENV SODIUM_INSTALL system
ENV SODIUM_INSTALL=system



FROM core-build as core
FROM core-build AS core

ARG PCX_DISCORDBOT_BUILD
ARG PCX_DISCORDBOT_COMMIT

ENV PCX_DISCORDBOT_BUILD ${PCX_DISCORDBOT_BUILD}
ENV PCX_DISCORDBOT_COMMIT ${PCX_DISCORDBOT_COMMIT}
ENV PCX_DISCORDBOT_TAG core
ENV PYLAV__IN_CONTAINER 1
ENV PCX_DISCORDBOT_BUILD=${PCX_DISCORDBOT_BUILD} PCX_DISCORDBOT_COMMIT=${PCX_DISCORDBOT_COMMIT} PCX_DISCORDBOT_TAG=core

COPY root/ /

CMD ["/app/start-redbot.sh"]

#######################################################################################

FROM core-build as extra-build
FROM core-build AS extra-build

RUN set -eux; \
# Install popular cog dependencies
Expand All @@ -75,79 +72,70 @@ RUN set -eux; \



FROM extra-build as extra
FROM extra-build AS extra

ARG PCX_DISCORDBOT_BUILD
ARG PCX_DISCORDBOT_COMMIT

ENV PCX_DISCORDBOT_BUILD ${PCX_DISCORDBOT_BUILD}
ENV PCX_DISCORDBOT_COMMIT ${PCX_DISCORDBOT_COMMIT}
ENV PCX_DISCORDBOT_TAG extra
ENV PYLAV__IN_CONTAINER 1
ENV PCX_DISCORDBOT_BUILD=${PCX_DISCORDBOT_BUILD} PCX_DISCORDBOT_COMMIT=${PCX_DISCORDBOT_COMMIT} PCX_DISCORDBOT_TAG=extra

COPY root/ /

CMD ["/app/start-redbot.sh"]

#######################################################################################

FROM core-build as core-audio-build
FROM core-build AS core-audio-build

RUN set -eux; \
# Install redbot audio dependencies
apt-get update; \
apt-get install -y --no-install-recommends \
openjdk-11-jre-headless \
openjdk-17-jre-headless \
; \
rm -rf /var/lib/apt/lists/*;



FROM core-audio-build as core-audio
FROM core-audio-build AS core-audio

ARG PCX_DISCORDBOT_BUILD
ARG PCX_DISCORDBOT_COMMIT

ENV PCX_DISCORDBOT_BUILD ${PCX_DISCORDBOT_BUILD}
ENV PCX_DISCORDBOT_COMMIT ${PCX_DISCORDBOT_COMMIT}
ENV PCX_DISCORDBOT_TAG core-audio
ENV PYLAV__IN_CONTAINER 1
ENV PCX_DISCORDBOT_BUILD=${PCX_DISCORDBOT_BUILD} PCX_DISCORDBOT_COMMIT=${PCX_DISCORDBOT_COMMIT} PCX_DISCORDBOT_TAG=core-audio

COPY root/ /

CMD ["/app/start-redbot.sh"]

#######################################################################################

FROM extra-build as extra-audio-build
FROM extra-build AS extra-audio-build

RUN set -eux; \
# Install redbot audio dependencies
apt-get update; \
apt-get install -y --no-install-recommends \
openjdk-11-jre-headless \
openjdk-17-jre-headless \
; \
rm -rf /var/lib/apt/lists/*;



FROM extra-audio-build as extra-audio
FROM extra-audio-build AS extra-audio

ARG PCX_DISCORDBOT_BUILD
ARG PCX_DISCORDBOT_COMMIT

ENV PCX_DISCORDBOT_BUILD ${PCX_DISCORDBOT_BUILD}
ENV PCX_DISCORDBOT_COMMIT ${PCX_DISCORDBOT_COMMIT}
ENV PCX_DISCORDBOT_TAG extra-audio
ENV PYLAV__IN_CONTAINER 1
ENV PCX_DISCORDBOT_BUILD=${PCX_DISCORDBOT_BUILD} PCX_DISCORDBOT_COMMIT=${PCX_DISCORDBOT_COMMIT} PCX_DISCORDBOT_TAG=extra-audio

COPY root/ /

CMD ["/app/start-redbot.sh"]

#######################################################################################

FROM core-build as core-pylav-build
FROM core-build AS core-pylav-build

RUN set -eux; \
# Install pylav dependencies
Expand All @@ -160,25 +148,21 @@ RUN set -eux; \
mkdir -p /data/pylav;


FROM core-pylav-build as core-pylav
FROM core-pylav-build AS core-pylav

ARG PCX_DISCORDBOT_BUILD
ARG PCX_DISCORDBOT_COMMIT

ENV PCX_DISCORDBOT_BUILD ${PCX_DISCORDBOT_BUILD}
ENV PCX_DISCORDBOT_COMMIT ${PCX_DISCORDBOT_COMMIT}
ENV PCX_DISCORDBOT_TAG core-pylav
ENV PYLAV__DATA_FOLDER /data/pylav
ENV PYLAV__YAML_CONFIG /data/pylav/pylav.yaml
ENV PYLAV__IN_CONTAINER 1
ENV PCX_DISCORDBOT_BUILD=${PCX_DISCORDBOT_BUILD} PCX_DISCORDBOT_COMMIT=${PCX_DISCORDBOT_COMMIT} PCX_DISCORDBOT_TAG=core-pylav
ENV PYLAV__DATA_FOLDER=/data/pylav PYLAV__YAML_CONFIG=/data/pylav/pylav.yaml PYLAV__IN_CONTAINER=1

COPY root/ /

CMD ["/app/start-redbot.sh"]

#######################################################################################

FROM extra-build as extra-pylav-build
FROM extra-build AS extra-pylav-build

RUN set -eux; \
# Install pylav dependencies
Expand All @@ -191,17 +175,13 @@ RUN set -eux; \
mkdir -p /data/pylav;


FROM extra-pylav-build as extra-pylav
FROM extra-pylav-build AS extra-pylav

ARG PCX_DISCORDBOT_BUILD
ARG PCX_DISCORDBOT_COMMIT

ENV PCX_DISCORDBOT_BUILD ${PCX_DISCORDBOT_BUILD}
ENV PCX_DISCORDBOT_COMMIT ${PCX_DISCORDBOT_COMMIT}
ENV PCX_DISCORDBOT_TAG extra-pylav
ENV PYLAV__DATA_FOLDER /data/pylav
ENV PYLAV__YAML_CONFIG /data/pylav/pylav.yaml
ENV PYLAV__IN_CONTAINER 1
ENV PCX_DISCORDBOT_BUILD=${PCX_DISCORDBOT_BUILD} PCX_DISCORDBOT_COMMIT=${PCX_DISCORDBOT_COMMIT} PCX_DISCORDBOT_TAG=extra-pylav
ENV PYLAV__DATA_FOLDER=/data/pylav PYLAV__YAML_CONFIG=/data/pylav/pylav.yaml PYLAV__IN_CONTAINER=1

COPY root/ /

Expand Down
10 changes: 7 additions & 3 deletions root/app/functions/update-redbot.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env sh
set -euf

stringContain() { case $2 in *$1* ) return 0;; *) return 1;; esac ;}

# Make sure we are in the venv
[ -n "${VIRTUAL_ENV:-}" ]

Expand All @@ -13,9 +15,11 @@ if [ "${STORAGE_TYPE}" != "json" ]; then
SETUPTOOLS_EXTRAS="[${STORAGE_TYPE}]"
fi

if [ -z "${PYLAV__DOCKER_DEV_SKIP_INSTALL:-}" ]; then
git config --global --add safe.directory '*'
python /app/functions/pylav_setup.py
if stringContain "pylav" "${PCX_DISCORDBOT_TAG}"; then
if [ -z "${PYLAV__DOCKER_DEV_SKIP_INSTALL:-}" ]; then
git config --global --add safe.directory '*'
python /app/functions/pylav_setup.py
fi
fi

if [ -n "${CUSTOM_REDBOT_PACKAGE:-}" ]; then
Expand Down
File renamed without changes.

0 comments on commit 4d741d0

Please sign in to comment.