Blame view

conf/dachs-dockerfile 3.23 KB
de175623   Philippe Hamy   ajoute la conf do...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
ARG VERSION
FROM debian:$VERSION

ARG SERVER
ARG GITURL
ARG GIT
ARG HOMEPATH=/home/dachsroot


###
#install de la clé + depot Dachs
# ajout de postgres en amont sinon l'install de dachs plante
###

RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get install -y curl apt-utils

RUN curl -o /etc/apt/trusted.gpg.d/gavo-archive.key.asc https://docs.g-vo.org/archive-key.asc
RUN echo "deb http://vo.ari.uni-heidelberg.de/debian release main" > /etc/apt/sources.list.d/dachs.list


###
# Configuration du serveur
###

RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get install -y postgresql postgresql-pgsphere postgresql-q3c
RUN service postgresql restart && apt-get install -y git gavodachs2-server wget awstats geoip-database libgeo-ipfree-perl
RUN apt-get install -y git openssh-server openssh-client apache2 w3m net-tools vim


###
# Ajout des clés ssh
# port utilisé par defaut 2222
###

RUN mkdir -p /root/.ssh
2c855ded   Benjamin Renard   Test
40
RUN echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL8LvPlnTGHhoqSARTPjjlxxHJPJ9oS+vvx7TmpC51e4 GitLab OBSPM" >> /root/.ssh/authorized_keys
de175623   Philippe Hamy   ajoute la conf do...
41
42
43
44
RUN chmod 700 /root/.ssh
RUN chmod 600 /root/.ssh/authorized_keys

RUN mkdir -p /home/dachsroot/.ssh
2c855ded   Benjamin Renard   Test
45
RUN echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL8LvPlnTGHhoqSARTPjjlxxHJPJ9oS+vvx7TmpC51e4 GitLab OBSPM" >> /home/dachsroot/.ssh/authorized_keys
de175623   Philippe Hamy   ajoute la conf do...
46
47
48
49
50
51
52
53
54
55
RUN chmod 700 /home/dachsroot/.ssh
RUN chmod 600 /home/dachsroot/.ssh/authorized_keys
RUN chown dachsroot:gavo -R /home/dachsroot/.ssh


###
# Installation des sources
###

RUN mkdir $PATH$SERVER -p
4419e093   Benjamin Renard   Disable ssl verify
56
RUN git clone -c http.sslVerify=0 $GITURL/$GIT.git $HOMEPATH/$SERVER/$GIT
de175623   Philippe Hamy   ajoute la conf do...
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111

#on déplace les fichiers
RUN cp $HOMEPATH/$SERVER/$GIT/conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
RUN cp $HOMEPATH/$SERVER/$GIT/conf/ports.conf /etc/apache2/ports.conf
RUN cp $HOMEPATH/$SERVER/$GIT/conf/awstats.dachs.conf /etc/awstats/awstats.dachs.conf
RUN cp $HOMEPATH/$SERVER/$GIT/conf/gavo.rc /etc/gavo.rc
RUN cp $HOMEPATH/$SERVER/$GIT/conf/docker-entrypoint.sh /usr/bin/docker-entrypoint.sh
RUN chmod +x /usr/bin/docker-entrypoint.sh
RUN cp $HOMEPATH/$SERVER/$GIT/conf/defaultmeta.txt /var/gavo/etc/defaultmeta.txt
RUN mkdir /var/gavo/web/nv_static/img/ -p
RUN cp $HOMEPATH/$SERVER/$GIT/conf/logo* /var/gavo/web/nv_static/img/
RUN cp -r $HOMEPATH/$SERVER/$GIT/services/* /var/gavo/inputs/


###
#configuration de dachs
###

RUN chown dachsroot:gavo /var/gavo/etc/defaultmeta.txt
RUN chown dachsroot:gavo /var/gavo/web/nv_static/img/logo*
RUN chown -R dachsroot:gavo /var/gavo/inputs/*


###
#configuration d'apache
###

RUN a2enmod cgi


###
# maj auto des donnnées awstats par cron
###

RUN echo "#!/bin/bash" > /etc/cron.daily/awstats
RUN echo "/usr/bin/perl /usr/lib/cgi-bin/awstats.pl -config=dachs -update" >> /etc/cron.daily/awstats
RUN chgrp 755 /etc/cron.daily/awstats


###
# Script de démarrage des servcices
###

RUN echo "cd $HOMEPATH/$SERVER/$GIT/" >> /usr/bin/docker-entrypoint.sh
RUN echo "git pull" >> /usr/bin/docker-entrypoint.sh
# ajout au script pour maintenir docker up
#RUN echo "tail -f /dev/null" >> /usr/bin/docker-entrypoint.sh


ENTRYPOINT /usr/bin/docker-entrypoint.sh && tail -f /dev/null

#ajout de clé ssh notamment pour les depots git--> clé privé danger
#vérifier les sub
#permettre l'acces ssh au moins au docker (hyperviseur aussi ?)
#faire un script maj