Commit d2ebcd281a6218315ea784c30da978c170e087b9

Authored by Chloé Azria
1 parent 7056e291
Exists in master

add a parameter for container name

Showing 3 changed files with 17 additions and 12 deletions   Show diff stats
conf/.env
... ... @@ -6,6 +6,9 @@ GITREPO_INSTITUTION=PADC
6 6 GITREPO_SERVER=voparis-tap-example
7 7  
8 8  
  9 +
  10 +#########Be careful, the .env parameters have priority on gavo.rc from gitlab
  11 +
9 12 #Following parameters will take default values if commented :
10 13 DACHS_PORT=81
11 14 #default 80
... ... @@ -14,9 +17,10 @@ APACHE_PORT=8081
14 17 SERVERNAME=localhost
15 18 #name of the host machine - default to localhost, for dev
16 19 DOMAIN=
17   -#default to ""
  20 +#default to empty string for localhost
18 21 PROTOCOL=http
19 22 #default to http
  23 +CONTAINER_NAME=dachs_voparis
20 24  
21 25 #note the default ports inside the container will be binded to DACHS_PORT and AWSTATS_PORT of the host machine
22 26  
... ...
conf/dachs-dockerfile
... ... @@ -66,7 +66,7 @@ RUN cp -r $HOMEPATH/services/* /var/gavo/inputs/
66 66 ######
67 67  
68 68 ##Adapt 000-default.conf ports and maintainer (taken from gavo.rc)
69   -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
  69 +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
70 70 RUN sed -i "s/8080/${APACHE_PORT}/g" /etc/apache2/sites-enabled/000-default.conf
71 71  
72 72 ##Adapt ports.conf with APACHE PORT
... ... @@ -85,12 +85,17 @@ RUN sed -i "/serverPort/c\serverPort:${DACHS_PORT}" /etc/gavo.rc
85 85 RUN sed -i "/corsOriginPat/c\corsOriginPat:${PROTOCOL}.*" /etc/gavo.rc
86 86  
87 87 RUN if [ "$SERVERNAME" = "localhost" ]; then \
  88 + less /etc/gavo.rc &&\
88 89 sed -i "/serverURL/c\serverURL:" /etc/gavo.rc &&\
89   - echo "############################ WARNING gavo.rc overwrite -- localhost for dev only ###############################" \
  90 + echo "############################ WARNING gavo.rc overwrite -- use localhost for dev only ###############################" \
  91 + less /etc/gavo.rc \
90 92 ; else \
  93 + less /etc/gavo.rc &&\
91 94 sed -i "/serverURL/c\serverURL:${PROTOCOL}://${SERVERNAME}.${DOMAIN}:${DACHS_PORT}" /etc/gavo.rc &&\
92   - echo "Warning : gavo.rc overwritten by .env servername, domain, protocol and port values" \
  95 + echo "Warning : gavo.rc overwritten by .env servername, domain, protocol and port values" &&\
  96 + less /etc/gavo.rc \
93 97 ; fi
  98 +
94 99  
95 100 ###
96 101 #dachs configuration
... ...
conf/docker-compose.yml
... ... @@ -2,8 +2,8 @@ version: "3.5"
2 2 services:
3 3  
4 4 dachs:
5   - container_name: dachs-voparis
6   - image: dachs-voparis
  5 + container_name: ${CONTAINER_NAME}
  6 + image: ${CONTAINER_NAME}
7 7  
8 8 tty: true
9 9 expose:
... ... @@ -27,12 +27,8 @@ services:
27 27 - "DOMAIN=${DOMAIN}"
28 28 - "PROTOCOL=${PROTOCOL}"
29 29 volumes:
30   - #- ../apache/cgi-bin:/home/dachsroot/apache/cgi-bin
31 30 - ../apache/logapache:/var/log/apache2
32 31 - ../apache/dachslogs:/var/gavo/logs
33   -
34 32 # 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)
35   - #- paht/to/data:/var/gavo/inputs/service/data
36   -
37   -### To uncomment for production :
38   -# restart: always
  33 + #- path/to/data:/var/gavo/inputs/<<service>>/data
  34 + restart: always
... ...