diff --git a/.env b/.env index ce8b60c..9dcf421 100644 --- a/.env +++ b/.env @@ -7,13 +7,13 @@ GITREPO_SERVER=voparis-tap-example #Following parameters will take default values if commented : -DACHS_PORT=80 +DACHS_PORT=81 #default 80 -AWSTATS_PORT=8080 +APACHE_PORT=8081 #default 8080 SERVERNAME=localhost #name of the host machine - default to localhost, for dev -#DOMAIN= +#DOMAIN=`` #default to "" #note the default ports inside the container will be binded to DACHS_PORT and AWSTATS_PORT of the host machine diff --git a/awstats.dachs.conf b/awstats.dachs.conf index f3b84ab..f1b692c 100644 --- a/awstats.dachs.conf +++ b/awstats.dachs.conf @@ -153,7 +153,7 @@ LogSeparator=" " # Example: "ftp.domain.com" # Example: "domain.com" # -SiteDomain="myserver.mydomain" +SiteDomain="mydomain" # Enter here all other possible domain names, addresses or virtual host @@ -168,7 +168,7 @@ SiteDomain="myserver.mydomain" # Note: You can also use @/mypath/myfile if list of aliases are in a file. # Example: "www.myserver.com localhost 127.0.0.1 REGEX[mydomain\.(net|org)$]" # -HostAliases="localhost 127.0.0.1 myserver.mydomain mydomain" +HostAliases="localhost 127.0.0.1 myserver.mydomain" # If you want to have hosts reported by name instead of ip address, AWStats diff --git a/dachs-dockerfile b/dachs-dockerfile index 5015f8c..29cad77 100644 --- a/dachs-dockerfile +++ b/dachs-dockerfile @@ -6,16 +6,9 @@ ARG GITURL=https://voparis-gitlab.obspm.fr ARG GITREPO_SERVER ARG GITREPO_INSTITUTION ARG HOMEPATH=/home/dachsroot - -###ARGUMENTS WITH ITS DEFAULT VALUES, SET IT IN .ENV IF you want other values -#RUN if [ -z "$DACHS_PORT" ]; then export DACHS_PORT=80; fi && echo "DACHS_PORT=$DACHS_PORT" -#ARG DACHS_PORT=$DACHS_PORT -# -#RUN if [ -z "$AWSTATS_PORT" ]; then export AWSTATS_PORT=8080; fi -#ARG AWSTATS_PORT=$AWSTATS_PORT - -#RUN if [ -z "$DOMAIN" ]; then export DOMAIN=""; fi -#ARG DOMAIN=$DOMAIN +ARG DACHS_PORT +ARG APACHE_PORT +ARG SERVERNAME RUN apt-get -y update @@ -48,7 +41,6 @@ RUN git clone $GITURL/vespa/dachs/servers/$GITREPO_INSTITUTION/$GITREPO_SERVER.g # copy files at the right path RUN cp $HOMEPATH/000-default.conf /etc/apache2/sites-enabled/000-default.conf -RUN cp $HOMEPATH/ports.conf /etc/apache2/ports.conf RUN cp $HOMEPATH/awstats.dachs.conf /etc/awstats/awstats.dachs.conf RUN cp $HOMEPATH/docker-entrypoint.sh /usr/bin/docker-entrypoint.sh RUN chmod +x /usr/bin/docker-entrypoint.sh @@ -67,6 +59,14 @@ RUN cp -r $HOMEPATH/services/* /var/gavo/inputs/ #extract parameters values from gavo.rc +RUN export maintainerAddress=`grep "^maintainerAddress:" /etc/gavo.rc | cut -d ":" -f 2` && sed -i "s/webmaster@localhost/${maintainerAddress}/g" /etc/apache2/sites-enabled/000-default.conf && less /etc/apache2/sites-enabled/000-default.conf +RUN sed -i "s/80/${APACHE_PORT}/g" /etc/apache2/ports.conf +RUN sed -i "s/8080/${APACHE_PORT}/g" /etc/apache2/sites-enabled/000-default.conf +RUN sed -i "/serverPort/c\serverPort:${DACHS_PORT}" /etc/gavo.rc +RUN sed -i "/serverURL/c\serverURL:${SERVERNAME}" /etc/gavo.rc + +#replace infos into 000default.conf, awstats.dachs.conf, ports.conf +#RUN sed -i "s/webmaster@localhost/${maintainerAddress}/g" /etc/apache2/sites-enabled/000-default.conf ### diff --git a/docker-compose.yml b/docker-compose.yml index 4d17568..2221527 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,20 +7,23 @@ services: tty: true expose: - - "80" - - "8080" + - "${DACHS_PORT}" + - "${APACHE_PORT}" - "22" ports: - "2222:22" - - "${DACHS_PORT}:80" - - "${AWSTATS_PORT}:8080" + - "${DACHS_PORT}:${DACHS_PORT}" + - "${APACHE_PORT}:${APACHE_PORT}" build: context: . dockerfile: dachs-dockerfile - args: + args: - "VERSION=${VERSION}" - "GITREPO_INSTITUTION=${GITREPO_INSTITUTION}" - "GITREPO_SERVER=${GITREPO_SERVER}" + - "DACHS_PORT=${DACHS_PORT}" + - "APACHE_PORT=${APACHE_PORT}" + - "SERVERNAME=${SERVERNAME}" ### example if you need to mount volumes (e.g if your service needs to parse files or if you want to upload it through dachs) # volumes: -- libgit2 0.21.2