diff --git a/Dockerfile b/Dockerfile index cfe44eb..5d115e2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,9 +28,9 @@ FROM golang:1.15-buster AS src ENV GO111MODULE=on CGO_ENABLED=0 WORKDIR /go/src/github.com/mpolden/echoip RUN apt update && apt install -yy git -RUN git clone -q https://github.com/mpolden/echoip /go/src/github.com/mpolden/echoip -RUN cd /go/src/github.com/mpolden/echoip && make +RUN git clone -q https://github.com/mpolden/echoip /go/src/github.com/mpolden/echoip && cd /go/src/github.com/mpolden/echoip && make +FROM mpolden/echoip:latest as html FROM tianon/gosu:latest AS gosu FROM ${IMAGE_REPO}:${DISTRO_VERSION} AS build ARG USER @@ -65,12 +65,13 @@ USER ${USER} WORKDIR /root RUN set -ex ; \ - echo "" + mkdir -p "/opt/echoip" -COPY --from=src /go/bin/echoip /opt/echoip/ COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/gosu -COPY ./rootfs/. / +COPY --from=html /opt/echoip/. /opt/echoip/ +COPY --from=src /go/bin/echoip /opt/echoip/ COPY ./Dockerfile /root/Dockerfile +COPY ./rootfs/. / RUN set -ex ; \ echo "" @@ -143,7 +144,7 @@ ARG DISTRO_VERSION ARG PHP_VERSION USER ${USER} -WORKDIR /root +WORKDIR /opt/echoip LABEL maintainer="CasjaysDev " LABEL org.opencontainers.image.vendor="CasjaysDev" diff --git a/rootfs/usr/local/etc/docker/init.d/ifconfig.sh b/rootfs/usr/local/etc/docker/init.d/zz-ifconfig.sh similarity index 97% rename from rootfs/usr/local/etc/docker/init.d/ifconfig.sh rename to rootfs/usr/local/etc/docker/init.d/zz-ifconfig.sh index 06640f2..9dfa0c1 100755 --- a/rootfs/usr/local/etc/docker/init.d/ifconfig.sh +++ b/rootfs/usr/local/etc/docker/init.d/zz-ifconfig.sh @@ -90,7 +90,7 @@ RUN_DIR="/run/ifconfig" # set scripts pid dir LOG_DIR="/data/logs/ifconfig" # set log directory # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Set the working dir -WORK_DIR="" # set working directory +WORK_DIR="/opt/echoip" # set working directory # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Where to save passwords to ROOT_FILE_PREFIX="/config/secure/auth/root" # directory to save username/password for root user @@ -105,7 +105,7 @@ user_name="${IFCONFIG_USER_NAME:-}" # normal user name user_pass="${IFCONFIG_USER_PASS_WORD:-}" # normal user password # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # port which service is listening on -SERVICE_PORT="" +SERVICE_PORT="8080" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # User to use to launch service - IE: postgres RUNAS_USER="root" # normally root @@ -119,13 +119,13 @@ SERVICE_UID="0" # set the user id SERVICE_GID="0" # set the group id # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # execute command variables - keep single quotes variables will be expanded later -EXEC_CMD_BIN='echoip' # command to execute -EXEC_CMD_ARGS='-t /opt/echoip/html ' # command arguments -EXEC_CMD_ARGS+='-H x-forwarded-for -r -s -p ' # command arguments -EXEC_CMD_ARGS+='-a /opt/echoip/geoip/GeoLite2-ASN.mmdb ' # command arguments -EXEC_CMD_ARGS+='-c /opt/echoip/geoip/GeoLite2-City.mmdb ' # command arguments -EXEC_CMD_ARGS+='-f /opt/echoip/geoip/GeoLite2-Country.mmdb ' # command arguments -EXEC_PRE_SCRIPT='' # execute script before +EXEC_CMD_BIN='ifconfig' # command to execute +EXEC_CMD_ARGS='-H x-forwarded-for -r -s -p ' # command arguments +EXEC_CMD_ARGS+='-l $SERVICE_PORT -t /opt/echoip/html ' # command arguments +EXEC_CMD_ARGS+='-a /opt/echoip/geoip/GeoLite2-ASN.mmdb ' # command arguments +EXEC_CMD_ARGS+='-c /opt/echoip/geoip/GeoLite2-City.mmdb ' # command arguments +EXEC_CMD_ARGS+='-f /opt/echoip/geoip/GeoLite2-Country.mmdb ' # command arguments +EXEC_PRE_SCRIPT='' # execute script before # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Is this service a web server IS_WEB_SERVER="no" @@ -171,7 +171,7 @@ __update_conf_files() { local sysname="${SERVER_NAME:-${FULL_DOMAIN_NAME:-$HOSTNAME}}" # set hostname # CD into temp to bybass any permission errors - cd /tmp || false # lets keep shellcheck happy by adding false + #cd /tmp || false # lets keep shellcheck happy by adding false # delete files #__rm ""