Compare commits
2 commits
f8d8145338
...
ca13f51025
| Author | SHA1 | Date | |
|---|---|---|---|
| ca13f51025 | |||
|
|
6d0d615a2f |
2 changed files with 23 additions and 11 deletions
14
Dockerfile
14
Dockerfile
|
|
@ -4,10 +4,10 @@ LABEL maintainer="Deokgyu Yang <secugyu@gmail.com>" \
|
|||
|
||||
RUN apk update
|
||||
RUN apk add --no-cache \
|
||||
bash bash-completion supervisor tzdata shadow \
|
||||
bash bash-completion supervisor tzdata shadow git openssh-client \
|
||||
php82 php82-fpm php82-session php82-json php82-xml php82-mbstring php82-exif \
|
||||
php82-intl php82-gd php82-pecl-imagick php82-zip php82-opcache \
|
||||
ffmpeg imagemagick zip apache2-utils patch git
|
||||
ffmpeg imagemagick zip apache2-utils patch
|
||||
|
||||
# Environments
|
||||
ENV PUID=911
|
||||
|
|
@ -16,15 +16,7 @@ ENV TZ='Europe/Berlin'
|
|||
ENV HTPASSWD='false'
|
||||
ENV HTPASSWD_USER='guest'
|
||||
ENV HTPASSWD_PW=''
|
||||
|
||||
# Git repository argument (default empty)
|
||||
ARG REPO_URL=""
|
||||
RUN if [ -n "$REPO_URL" ]; then \
|
||||
git clone "$REPO_URL" /tmp/cloned && \
|
||||
mkdir -p /h5ai && \
|
||||
cp -r /tmp/cloned/* /h5ai && \
|
||||
rm -rf /tmp/cloned; \
|
||||
fi
|
||||
ENV GIT_REPO="https://code.shork.eu/shork.eu/Branding.git"
|
||||
|
||||
# Copy configuration files
|
||||
COPY config/h5ai.conf /etc/nginx/conf.d/h5ai.conf
|
||||
|
|
|
|||
|
|
@ -75,6 +75,26 @@ msg "Set permission for caching..."
|
|||
chmod -R 777 $conf_h5ai/public/cache
|
||||
chmod -R 777 $conf_h5ai/private/cache
|
||||
|
||||
# Clone external repository into /h5ai
|
||||
if [ -n "$GIT_REPO" ]; then
|
||||
msg "Git repository variable detected: $GIT_REPO"
|
||||
workdir="/tmp/cloned"
|
||||
rm -rf "$workdir"
|
||||
mkdir -p "$workdir"
|
||||
if git clone "$GIT_REPO" "$workdir"; then
|
||||
msg "Repository cloned to $workdir"
|
||||
mkdir -p /h5ai
|
||||
find /h5ai -mindepth 1 -maxdepth 1 -exec rm -rf {} + 2>/dev/null || true
|
||||
cp -a "$workdir"/. /h5ai/
|
||||
chown -R abc:abc /h5ai
|
||||
msg "Copied cloned repository contents into /h5ai"
|
||||
else
|
||||
msg "Failed to clone $GIT_REPO"
|
||||
fi
|
||||
else
|
||||
msg "No GIT_REPO provided; skipping clone step"
|
||||
fi
|
||||
|
||||
# If an user wants to set htpasswd
|
||||
if [ "$HTPASSWD" = "true" ]; then
|
||||
if [ ! -f "$conf_htpwd" ]; then
|
||||
|
|
|
|||
Loading…
Reference in a new issue