Compare commits
5 Commits
69d303c7a1
...
v2.1.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 40a01c4701 | |||
|
|
28e3b087b0 | ||
| 116a9574ce | |||
|
|
6c7216c0e1 | ||
| 7c98a6ceaf |
17
Dockerfile
17
Dockerfile
@@ -1,10 +1,18 @@
|
|||||||
FROM python:3.11-slim
|
FROM python:3.13-alpine AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY requirements.txt .
|
RUN apk add --no-cache gcc musl-dev jpeg-dev zlib-dev
|
||||||
|
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
COPY requirements.txt .
|
||||||
|
RUN pip wheel --no-cache-dir --wheel-dir=/wheels -r requirements.txt
|
||||||
|
|
||||||
|
FROM python:3.13-alpine
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY --from=builder /wheels /wheels
|
||||||
|
RUN pip install --no-cache-dir --find-links=/wheels /wheels/* && rm -rf /wheels
|
||||||
|
|
||||||
COPY build.py gallery.py VERSION /app/
|
COPY build.py gallery.py VERSION /app/
|
||||||
COPY ./src/ ./src/
|
COPY ./src/ ./src/
|
||||||
@@ -12,7 +20,4 @@ COPY ./config /app/default
|
|||||||
COPY ./docker/.sh/entrypoint.sh /app/entrypoint.sh
|
COPY ./docker/.sh/entrypoint.sh /app/entrypoint.sh
|
||||||
RUN chmod +x /app/entrypoint.sh
|
RUN chmod +x /app/entrypoint.sh
|
||||||
|
|
||||||
RUN printf '#!/bin/sh\n/app/entrypoint.sh build\n' > /usr/local/bin/build && chmod +x /usr/local/bin/build && \
|
|
||||||
printf '#!/bin/sh\n/app/entrypoint.sh gallery\n' > /usr/local/bin/gallery && chmod +x /usr/local/bin/gallery
|
|
||||||
|
|
||||||
ENTRYPOINT ["/app/entrypoint.sh"]
|
ENTRYPOINT ["/app/entrypoint.sh"]
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
CYAN="\033[1;36m"
|
CYAN="\033[1;36m"
|
||||||
@@ -6,27 +6,26 @@ NC="\033[0m"
|
|||||||
|
|
||||||
copy_default_config() {
|
copy_default_config() {
|
||||||
echo "[~] Checking configuration directory..."
|
echo "[~] Checking configuration directory..."
|
||||||
if [ ! -d "/app/config" ]; then
|
mkdir -p /app/config
|
||||||
mkdir -p /app/config
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "[~] Checking if default config files/folders need to be copied..."
|
echo "[~] Checking if default config files/folders need to be copied..."
|
||||||
files_copied=false
|
files_copied=false
|
||||||
|
|
||||||
# Recursively check all files and folders in /app/default
|
for src in $(find /app/default -mindepth 1); do
|
||||||
while IFS= read -r src; do
|
|
||||||
relpath="${src#/app/default/}"
|
relpath="${src#/app/default/}"
|
||||||
target="/app/config/$relpath"
|
target="/app/config/$relpath"
|
||||||
if [ ! -e "$target" ]; then
|
if [ ! -e "$target" ]; then
|
||||||
echo "[→] Copying: $relpath"
|
echo "[→] Copying: $relpath"
|
||||||
if [ -d "$src" ]; then
|
if [ -d "$src" ]; then
|
||||||
cp -r "$src" "$target"
|
mkdir -p "$target"
|
||||||
|
cp -r "$src/" "$target/"
|
||||||
else
|
else
|
||||||
|
mkdir -p "$(dirname "$target")"
|
||||||
cp "$src" "$target"
|
cp "$src" "$target"
|
||||||
fi
|
fi
|
||||||
files_copied=true
|
files_copied=true
|
||||||
fi
|
fi
|
||||||
done < <(find /app/default -mindepth 1)
|
done
|
||||||
|
|
||||||
if [ "$files_copied" = true ]; then
|
if [ "$files_copied" = true ]; then
|
||||||
echo "[✓] Default configuration files/folders copied successfully."
|
echo "[✓] Default configuration files/folders copied successfully."
|
||||||
|
|||||||
Reference in New Issue
Block a user