diff --git a/atheme/Dockerfile b/atheme/Dockerfile index bfde883..2e43cc5 100644 --- a/atheme/Dockerfile +++ b/atheme/Dockerfile @@ -19,7 +19,10 @@ RUN apk add \ g++ \ pkgconfig RUN ./configure \ - --prefix=/srv/atheme + --prefix=/srv/atheme \ + --sysconfdir=/srv/data/etc \ + --enable-fhs-paths \ + --localstatedir=/srv/data/var RUN cd libmowgli-2 && \ git pull origin master @@ -27,7 +30,8 @@ RUN cd libmowgli-2 && \ RUN apk add \ make RUN make -j${MK_THREADS:-$(nproc)} && \ - make install + make install && \ + mv /srv/data/* /srv/atheme/ FROM alpine:latest diff --git a/atheme/root/entrypoint.sh b/atheme/root/entrypoint.sh index 46d4c21..d8fc7fe 100755 --- a/atheme/root/entrypoint.sh +++ b/atheme/root/entrypoint.sh @@ -1,18 +1,16 @@ #!/bin/sh -DATADIR=/srv/data/etc +mkdir -p /srv/data/etc -mkdir -p "$DATADIR" +for file_path in /srv/atheme/etc/*.example; do + file_name="$(basename "$file_path")" + cp -n -p "$file_path" "/srv/data/etc/${file_name%%.example}" +done -chown atheme:atheme -R "$DATADIR" +cp -n -p -r /srv/atheme/var /srv/data/ -if [ ! -e $DATADIR/atheme.conf ]; then - printf "Configuration file not found. Generating it..." - cp /srv/atheme/etc/atheme.conf.example $DATADIR/atheme.conf -fi - -rm -f /srv/atheme/var/atheme.pid +rm -f /srv/data/var/run/atheme/atheme.pid su atheme \ -c "/srv/atheme/bin/atheme-services \ - -c $DATADIR/atheme.conf \ - -n" + -n \ + $*" diff --git a/docker-compose.yml b/docker-compose.yml index 3c6d684..0d8b15e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,6 +16,7 @@ services: - 9999:9999 environment: - TZ=${TZ} + command: ${SO_CMD} atheme: build: @@ -24,3 +25,7 @@ services: restart: ${AT_RESTART:-unless-stopped} volumes: - ${LOCAL_STACK_DIR}/atheme/data:/srv/data + command: ${AT_CMD} + +networks: + default: diff --git a/solanum/root/entrypoint.sh b/solanum/root/entrypoint.sh index 4f2e022..ead675e 100755 --- a/solanum/root/entrypoint.sh +++ b/solanum/root/entrypoint.sh @@ -2,18 +2,12 @@ mkdir -p /srv/data/etc /srv/data/logs -chown solanum:solanum -R /srv/data +chown solanum:solanum -R /srv/data/logs -if [ ! -e /srv/data/etc/ircd.conf ]; then - echo "Configuration file not found. Generating it..." - cp /srv/solanum/etc/ircd.conf.example /srv/data/etc/ircd.conf -fi - -if [ ! -e /srv/data/etc/ircd.motd ]; then - echo "MOTD file not found. Generating it..." - cp /srv/solanum/etc/ircd.motd /srv/data/etc/ircd.motd -fi +cp -n -p /srv/solanum/etc/ircd.conf.example /srv/data/etc/ircd.conf +cp -n -p /srv/solanum/etc/ircd.motd /srv/data/etc/ircd.motd su solanum \ -c "/srv/solanum/bin/solanum \ - -foreground" + -foreground \ + $*"