Commit f3c01bfb authored by ale's avatar ale
Browse files

Move static assets out of mounted data dirs

parent 0156a7ec
...@@ -7,6 +7,7 @@ RUN go build -o smtpd smtpd.go ...@@ -7,6 +7,7 @@ RUN go build -o smtpd smtpd.go
# Stage 2: build the final container # Stage 2: build the final container
FROM registry.git.autistici.org/ai3/docker/apache2-base:master FROM registry.git.autistici.org/ai3/docker/apache2-base:master
COPY start.sh /start.sh
COPY build.sh /tmp/build.sh COPY build.sh /tmp/build.sh
COPY conf/ /etc/ COPY conf/ /etc/
COPY --from=build /go/src/smtpd /usr/bin/smtpd COPY --from=build /go/src/smtpd /usr/bin/smtpd
......
...@@ -35,6 +35,14 @@ a2enconf -q serve-cgi-bin ...@@ -35,6 +35,14 @@ a2enconf -q serve-cgi-bin
# Create mountpoint dirs. # Create mountpoint dirs.
mkdir -p /var/lib/lurker mkdir -p /var/lib/lurker
# Lurker installs some package files in mountpoint directories,
# so the original files would disappear "below" the mount. To
# prevent this, we copy the files to a well-known location
# beforehand, and set up links at run-time.
mkdir -p /var/lib/lurker-www
mv /etc/lurker/ui /var/lib/lurker-www/ui
mv /var/lib/lurker/www/index.html /var/lib/lurker-www/index.html
# Clear the existing default config # Clear the existing default config
# (this will be mounted externally). # (this will be mounted externally).
rm -fr /etc/lurker/* rm -fr /etc/lurker/*
......
lurker_setup.service: {
type: oneshot,
stdout: inherit,
service_groups: INIT,
process_timeout: 60,
command: "/start.sh",
}
#!/bin/sh
www_dir=/var/lib/lurker/www
static_dir=/var/lib/lurker-www
echo "Fixing symlinks..." >&2
if [ ! -e ${www_dir}/imgs ]; then
ln -sf /usr/share/lurker/www/imgs ${www_dir}/imgs
fi
if [ ! -e ${www_dir}/index.html ]; then
ln -sf ${static_dir}/index.html ${www_dir}/index.html
fi
if [ ! -e ${www_dir}/ui ]; then
ln -sf ${static_dir}/ui ${www_dir}/ui
fi
if [ ! -e ${www_dir}/lurker.docroot ]; then
touch ${www_dir}/lurker.docroot
fi
exit 0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment