Skip to content

Commit e70ca6e

Browse files
f3l1xclaude
andcommitted
All: add ADMINER_THEME env for theme support (#66)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 463b7d8 commit e70ca6e

14 files changed

Lines changed: 193 additions & 7 deletions

File tree

adminer-editor/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ RUN echo '@community http://nl.alpinelinux.org/alpine/v3.22/community' >> /etc/a
1515
apk add \
1616
bash \
1717
wget \
18+
unzip \
1819
ca-certificates \
1920
php84@community \
2021
php84-session@community \
@@ -24,8 +25,13 @@ RUN echo '@community http://nl.alpinelinux.org/alpine/v3.22/community' >> /etc/a
2425
php84-pecl-mongodb@community \
2526
tini && \
2627
wget https://github.com/vrana/adminer/releases/download/v$ADMINER_EDITOR_VERSION/editor-$ADMINER_EDITOR_VERSION.php -O /srv/index.php && \
28+
wget https://github.com/vrana/adminer/releases/download/v$ADMINER_EDITOR_VERSION/adminer-$ADMINER_EDITOR_VERSION.zip -O /tmp/adminer-$ADMINER_EDITOR_VERSION.zip && \
29+
unzip /tmp/adminer-$ADMINER_EDITOR_VERSION.zip -d /tmp && \
30+
mkdir -p /srv/designs && \
31+
mv /tmp/adminer-$ADMINER_EDITOR_VERSION/designs/* /srv/designs/ 2>/dev/null || true && \
32+
rm -rf /tmp/* && \
2733
ln -s /usr/bin/php84 /usr/bin/php && \
28-
apk del wget ca-certificates && \
34+
apk del wget unzip ca-certificates && \
2935
rm -rf /var/cache/apk/*
3036

3137
ADD ./entrypoint.sh /entrypoint.sh

adminer-editor/entrypoint.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,27 @@ fi
1919

2020
echo "[adminer] Loading Adminer Editor..."
2121

22+
# Copy theme CSS files based on ADMINER_THEME environment variable
23+
if [ -n "${ADMINER_THEME}" ]; then
24+
THEME_DIR="/srv/designs/${ADMINER_THEME}"
25+
if [ -d "${THEME_DIR}" ]; then
26+
if [ -f "${THEME_DIR}/adminer.css" ]; then
27+
cp "${THEME_DIR}/adminer.css" /srv/adminer.css
28+
echo "[adminer] Theme '${ADMINER_THEME}' applied successfully."
29+
else
30+
echo "[adminer] Warning: Theme '${ADMINER_THEME}' does not contain adminer.css"
31+
fi
32+
if [ -f "${THEME_DIR}/adminer-dark.css" ]; then
33+
cp "${THEME_DIR}/adminer-dark.css" /srv/adminer-dark.css
34+
echo "[adminer] Dark mode CSS for theme '${ADMINER_THEME}' applied."
35+
fi
36+
else
37+
echo "[adminer] Warning: Theme '${ADMINER_THEME}' not found in /srv/designs/"
38+
echo "[adminer] Available themes:"
39+
ls -1 /srv/designs/ 2>/dev/null || echo "[adminer] No themes available."
40+
fi
41+
fi
42+
2243
# Set default values if not provided
2344
MEMORY=${MEMORY:-256M}
2445
UPLOAD=${UPLOAD:-2048M}

adminer-mongo/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,20 @@ RUN echo '@community http://nl.alpinelinux.org/alpine/v3.22/community' >> /etc/a
1515
apk add \
1616
bash \
1717
wget \
18+
unzip \
1819
ca-certificates \
1920
php84@community \
2021
php84-session@community \
2122
php84-pecl-mongodb@community \
2223
tini && \
2324
wget https://github.com/vrana/adminer/releases/download/v$ADMINER_VERSION/adminer-$ADMINER_VERSION.php -O /srv/index.php && \
25+
wget https://github.com/vrana/adminer/releases/download/v$ADMINER_VERSION/adminer-$ADMINER_VERSION.zip -O /tmp/adminer-$ADMINER_VERSION.zip && \
26+
unzip /tmp/adminer-$ADMINER_VERSION.zip -d /tmp && \
27+
mkdir -p /srv/designs && \
28+
mv /tmp/adminer-$ADMINER_VERSION/designs/* /srv/designs/ 2>/dev/null || true && \
29+
rm -rf /tmp/* && \
2430
ln -s /usr/bin/php84 /usr/bin/php && \
25-
apk del wget ca-certificates && \
31+
apk del wget unzip ca-certificates && \
2632
rm -rf /var/cache/apk/*
2733

2834
ADD ./entrypoint.sh /entrypoint.sh

adminer-mongo/entrypoint.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,27 @@ fi
1919

2020
echo "[adminer] Loading Adminer (MongoDB)..."
2121

22+
# Copy theme CSS files based on ADMINER_THEME environment variable
23+
if [ -n "${ADMINER_THEME}" ]; then
24+
THEME_DIR="/srv/designs/${ADMINER_THEME}"
25+
if [ -d "${THEME_DIR}" ]; then
26+
if [ -f "${THEME_DIR}/adminer.css" ]; then
27+
cp "${THEME_DIR}/adminer.css" /srv/adminer.css
28+
echo "[adminer] Theme '${ADMINER_THEME}' applied successfully."
29+
else
30+
echo "[adminer] Warning: Theme '${ADMINER_THEME}' does not contain adminer.css"
31+
fi
32+
if [ -f "${THEME_DIR}/adminer-dark.css" ]; then
33+
cp "${THEME_DIR}/adminer-dark.css" /srv/adminer-dark.css
34+
echo "[adminer] Dark mode CSS for theme '${ADMINER_THEME}' applied."
35+
fi
36+
else
37+
echo "[adminer] Warning: Theme '${ADMINER_THEME}' not found in /srv/designs/"
38+
echo "[adminer] Available themes:"
39+
ls -1 /srv/designs/ 2>/dev/null || echo "[adminer] No themes available."
40+
fi
41+
fi
42+
2243
# Set default values if not provided
2344
MEMORY=${MEMORY:-256M}
2445
UPLOAD=${UPLOAD:-2048M}

adminer-mysql/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,20 @@ RUN echo '@community http://nl.alpinelinux.org/alpine/v3.22/community' >> /etc/a
1515
apk add \
1616
bash \
1717
wget \
18+
unzip \
1819
ca-certificates \
1920
php84@community \
2021
php84-session@community \
2122
php84-mysqli@community \
2223
tini && \
2324
wget https://github.com/vrana/adminer/releases/download/v$ADMINER_VERSION/adminer-$ADMINER_VERSION.php -O /srv/index.php && \
25+
wget https://github.com/vrana/adminer/releases/download/v$ADMINER_VERSION/adminer-$ADMINER_VERSION.zip -O /tmp/adminer-$ADMINER_VERSION.zip && \
26+
unzip /tmp/adminer-$ADMINER_VERSION.zip -d /tmp && \
27+
mkdir -p /srv/designs && \
28+
mv /tmp/adminer-$ADMINER_VERSION/designs/* /srv/designs/ 2>/dev/null || true && \
29+
rm -rf /tmp/* && \
2430
ln -s /usr/bin/php84 /usr/bin/php && \
25-
apk del wget ca-certificates && \
31+
apk del wget unzip ca-certificates && \
2632
rm -rf /var/cache/apk/*
2733

2834
ADD ./entrypoint.sh /entrypoint.sh

adminer-mysql/entrypoint.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,27 @@ fi
1919

2020
echo "[adminer] Loading Adminer (MySQL)..."
2121

22+
# Copy theme CSS files based on ADMINER_THEME environment variable
23+
if [ -n "${ADMINER_THEME}" ]; then
24+
THEME_DIR="/srv/designs/${ADMINER_THEME}"
25+
if [ -d "${THEME_DIR}" ]; then
26+
if [ -f "${THEME_DIR}/adminer.css" ]; then
27+
cp "${THEME_DIR}/adminer.css" /srv/adminer.css
28+
echo "[adminer] Theme '${ADMINER_THEME}' applied successfully."
29+
else
30+
echo "[adminer] Warning: Theme '${ADMINER_THEME}' does not contain adminer.css"
31+
fi
32+
if [ -f "${THEME_DIR}/adminer-dark.css" ]; then
33+
cp "${THEME_DIR}/adminer-dark.css" /srv/adminer-dark.css
34+
echo "[adminer] Dark mode CSS for theme '${ADMINER_THEME}' applied."
35+
fi
36+
else
37+
echo "[adminer] Warning: Theme '${ADMINER_THEME}' not found in /srv/designs/"
38+
echo "[adminer] Available themes:"
39+
ls -1 /srv/designs/ 2>/dev/null || echo "[adminer] No themes available."
40+
fi
41+
fi
42+
2243
# Set default values if not provided
2344
MEMORY=${MEMORY:-256M}
2445
UPLOAD=${UPLOAD:-2048M}

adminer-oracle-11/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ RUN apt-get update && \
2929
php8.4-xml \
3030
php-pear \
3131
tini && \
32-
wget https://github.com/vrana/adminer/releases/download/v$ADMINER_VERSION/adminer-$ADMINER_VERSION.php -O /srv/index.php
32+
wget https://github.com/vrana/adminer/releases/download/v$ADMINER_VERSION/adminer-$ADMINER_VERSION.php -O /srv/index.php && \
33+
wget https://github.com/vrana/adminer/releases/download/v$ADMINER_VERSION/adminer-$ADMINER_VERSION.zip -O /tmp/adminer-$ADMINER_VERSION.zip && \
34+
unzip /tmp/adminer-$ADMINER_VERSION.zip -d /tmp && \
35+
mkdir -p /srv/designs && \
36+
mv /tmp/adminer-$ADMINER_VERSION/designs/* /srv/designs/ 2>/dev/null || true && \
37+
rm -rf /tmp/*
3338

3439
# OCI8 (ORACLE) ################################################################
3540
RUN wget https://github.com/f00b4r/oracle-instantclient/raw/master/instantclient-basic-linux.x64-11.2.0.4.0.zip -O /tmp/instantclient-basic-linux.x64-11.2.0.4.0.zip && \

adminer-oracle-11/entrypoint.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,27 @@ fi
1919

2020
echo "[adminer] Loading Adminer (Oracle 11)..."
2121

22+
# Copy theme CSS files based on ADMINER_THEME environment variable
23+
if [ -n "${ADMINER_THEME}" ]; then
24+
THEME_DIR="/srv/designs/${ADMINER_THEME}"
25+
if [ -d "${THEME_DIR}" ]; then
26+
if [ -f "${THEME_DIR}/adminer.css" ]; then
27+
cp "${THEME_DIR}/adminer.css" /srv/adminer.css
28+
echo "[adminer] Theme '${ADMINER_THEME}' applied successfully."
29+
else
30+
echo "[adminer] Warning: Theme '${ADMINER_THEME}' does not contain adminer.css"
31+
fi
32+
if [ -f "${THEME_DIR}/adminer-dark.css" ]; then
33+
cp "${THEME_DIR}/adminer-dark.css" /srv/adminer-dark.css
34+
echo "[adminer] Dark mode CSS for theme '${ADMINER_THEME}' applied."
35+
fi
36+
else
37+
echo "[adminer] Warning: Theme '${ADMINER_THEME}' not found in /srv/designs/"
38+
echo "[adminer] Available themes:"
39+
ls -1 /srv/designs/ 2>/dev/null || echo "[adminer] No themes available."
40+
fi
41+
fi
42+
2243
# Set default values if not provided
2344
MEMORY=${MEMORY:-256M}
2445
UPLOAD=${UPLOAD:-2048M}

adminer-oracle-12/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ RUN apt-get update && \
2929
php8.4-xml \
3030
php-pear \
3131
tini && \
32-
wget https://github.com/vrana/adminer/releases/download/v$ADMINER_VERSION/adminer-$ADMINER_VERSION.php -O /srv/index.php
32+
wget https://github.com/vrana/adminer/releases/download/v$ADMINER_VERSION/adminer-$ADMINER_VERSION.php -O /srv/index.php && \
33+
wget https://github.com/vrana/adminer/releases/download/v$ADMINER_VERSION/adminer-$ADMINER_VERSION.zip -O /tmp/adminer-$ADMINER_VERSION.zip && \
34+
unzip /tmp/adminer-$ADMINER_VERSION.zip -d /tmp && \
35+
mkdir -p /srv/designs && \
36+
mv /tmp/adminer-$ADMINER_VERSION/designs/* /srv/designs/ 2>/dev/null || true && \
37+
rm -rf /tmp/*
3338

3439
# OCI8 (ORACLE) ################################################################
3540
RUN wget https://github.com/f00b4r/oracle-instantclient/raw/master/instantclient-basic-linux.x64-12.1.0.2.0.zip -O /tmp/instantclient-basic-linux.x64-12.1.0.2.0.zip && \

adminer-oracle-12/entrypoint.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,27 @@ fi
1919

2020
echo "[adminer] Loading Adminer (Oracle 12)..."
2121

22+
# Copy theme CSS files based on ADMINER_THEME environment variable
23+
if [ -n "${ADMINER_THEME}" ]; then
24+
THEME_DIR="/srv/designs/${ADMINER_THEME}"
25+
if [ -d "${THEME_DIR}" ]; then
26+
if [ -f "${THEME_DIR}/adminer.css" ]; then
27+
cp "${THEME_DIR}/adminer.css" /srv/adminer.css
28+
echo "[adminer] Theme '${ADMINER_THEME}' applied successfully."
29+
else
30+
echo "[adminer] Warning: Theme '${ADMINER_THEME}' does not contain adminer.css"
31+
fi
32+
if [ -f "${THEME_DIR}/adminer-dark.css" ]; then
33+
cp "${THEME_DIR}/adminer-dark.css" /srv/adminer-dark.css
34+
echo "[adminer] Dark mode CSS for theme '${ADMINER_THEME}' applied."
35+
fi
36+
else
37+
echo "[adminer] Warning: Theme '${ADMINER_THEME}' not found in /srv/designs/"
38+
echo "[adminer] Available themes:"
39+
ls -1 /srv/designs/ 2>/dev/null || echo "[adminer] No themes available."
40+
fi
41+
fi
42+
2243
# Set default values if not provided
2344
MEMORY=${MEMORY:-256M}
2445
UPLOAD=${UPLOAD:-2048M}

0 commit comments

Comments
 (0)