Commit a68aedba2e1032e2f6a0d90589eef54b49b8cc17

Authored by Chloé Azria
1 parent 7eb59551
Exists in master

idk why redirects to http://localhost:81/localhost/__system__/adql/query/form

.env
... ... @@ -7,13 +7,13 @@ GITREPO_SERVER=voparis-tap-example
7 7  
8 8  
9 9 #Following parameters will take default values if commented :
10   -DACHS_PORT=80
  10 +DACHS_PORT=81
11 11 #default 80
12   -AWSTATS_PORT=8080
  12 +APACHE_PORT=8081
13 13 #default 8080
14 14 SERVERNAME=localhost
15 15 #name of the host machine - default to localhost, for dev
16   -#DOMAIN=
  16 +#DOMAIN=``
17 17 #default to ""
18 18  
19 19 #note the default ports inside the container will be binded to DACHS_PORT and AWSTATS_PORT of the host machine
... ...
awstats.dachs.conf
... ... @@ -153,7 +153,7 @@ LogSeparator=" "
153 153 # Example: "ftp.domain.com"
154 154 # Example: "domain.com"
155 155 #
156   -SiteDomain="myserver.mydomain"
  156 +SiteDomain="mydomain"
157 157  
158 158  
159 159 # Enter here all other possible domain names, addresses or virtual host
... ... @@ -168,7 +168,7 @@ SiteDomain="myserver.mydomain"
168 168 # Note: You can also use @/mypath/myfile if list of aliases are in a file.
169 169 # Example: "www.myserver.com localhost 127.0.0.1 REGEX[mydomain\.(net|org)$]"
170 170 #
171   -HostAliases="localhost 127.0.0.1 myserver.mydomain mydomain"
  171 +HostAliases="localhost 127.0.0.1 myserver.mydomain"
172 172  
173 173  
174 174 # If you want to have hosts reported by name instead of ip address, AWStats
... ...
dachs-dockerfile
... ... @@ -6,16 +6,9 @@ ARG GITURL=https://voparis-gitlab.obspm.fr
6 6 ARG GITREPO_SERVER
7 7 ARG GITREPO_INSTITUTION
8 8 ARG HOMEPATH=/home/dachsroot
9   -
10   -###ARGUMENTS WITH ITS DEFAULT VALUES, SET IT IN .ENV IF you want other values
11   -#RUN if [ -z "$DACHS_PORT" ]; then export DACHS_PORT=80; fi && echo "DACHS_PORT=$DACHS_PORT"
12   -#ARG DACHS_PORT=$DACHS_PORT
13   -#
14   -#RUN if [ -z "$AWSTATS_PORT" ]; then export AWSTATS_PORT=8080; fi
15   -#ARG AWSTATS_PORT=$AWSTATS_PORT
16   -
17   -#RUN if [ -z "$DOMAIN" ]; then export DOMAIN=""; fi
18   -#ARG DOMAIN=$DOMAIN
  9 +ARG DACHS_PORT
  10 +ARG APACHE_PORT
  11 +ARG SERVERNAME
19 12  
20 13  
21 14 RUN apt-get -y update
... ... @@ -48,7 +41,6 @@ RUN git clone $GITURL/vespa/dachs/servers/$GITREPO_INSTITUTION/$GITREPO_SERVER.g
48 41  
49 42 # copy files at the right path
50 43 RUN cp $HOMEPATH/000-default.conf /etc/apache2/sites-enabled/000-default.conf
51   -RUN cp $HOMEPATH/ports.conf /etc/apache2/ports.conf
52 44 RUN cp $HOMEPATH/awstats.dachs.conf /etc/awstats/awstats.dachs.conf
53 45 RUN cp $HOMEPATH/docker-entrypoint.sh /usr/bin/docker-entrypoint.sh
54 46 RUN chmod +x /usr/bin/docker-entrypoint.sh
... ... @@ -67,6 +59,14 @@ RUN cp -r $HOMEPATH/services/* /var/gavo/inputs/
67 59  
68 60 #extract parameters values from gavo.rc
69 61  
  62 +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
  63 +RUN sed -i "s/80/${APACHE_PORT}/g" /etc/apache2/ports.conf
  64 +RUN sed -i "s/8080/${APACHE_PORT}/g" /etc/apache2/sites-enabled/000-default.conf
  65 +RUN sed -i "/serverPort/c\serverPort:${DACHS_PORT}" /etc/gavo.rc
  66 +RUN sed -i "/serverURL/c\serverURL:${SERVERNAME}" /etc/gavo.rc
  67 +
  68 +#replace infos into 000default.conf, awstats.dachs.conf, ports.conf
  69 +#RUN sed -i "s/webmaster@localhost/${maintainerAddress}/g" /etc/apache2/sites-enabled/000-default.conf
70 70  
71 71  
72 72 ###
... ...
docker-compose.yml
... ... @@ -7,20 +7,23 @@ services:
7 7  
8 8 tty: true
9 9 expose:
10   - - "80"
11   - - "8080"
  10 + - "${DACHS_PORT}"
  11 + - "${APACHE_PORT}"
12 12 - "22"
13 13 ports:
14 14 - "2222:22"
15   - - "${DACHS_PORT}:80"
16   - - "${AWSTATS_PORT}:8080"
  15 + - "${DACHS_PORT}:${DACHS_PORT}"
  16 + - "${APACHE_PORT}:${APACHE_PORT}"
17 17 build:
18 18 context: .
19 19 dockerfile: dachs-dockerfile
20   - args:
  20 + args:
21 21 - "VERSION=${VERSION}"
22 22 - "GITREPO_INSTITUTION=${GITREPO_INSTITUTION}"
23 23 - "GITREPO_SERVER=${GITREPO_SERVER}"
  24 + - "DACHS_PORT=${DACHS_PORT}"
  25 + - "APACHE_PORT=${APACHE_PORT}"
  26 + - "SERVERNAME=${SERVERNAME}"
24 27  
25 28 ### 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)
26 29 # volumes:
... ...