File tree Expand file tree Collapse file tree 4 files changed +71
-0
lines changed Expand file tree Collapse file tree 4 files changed +71
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM HouseOfAgile/docker-nginx-php-fpm:latest
2
+
3
+ MAINTAINER Meillaud Jean-Christophe (
[email protected] )
4
+
5
+ # Node install
6
+ RUN add-apt-repository ppa:chris-lea/node.js
7
+ RUN apt-get update
8
+
9
+ RUN apt-get install -y nodejs
10
+ RUN npm install less -g
11
+ RUN npm install -g bower
12
+
13
+ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/
14
+ RUN mv /usr/bin/composer.phar /usr/bin/composer
15
+
16
+ ADD ./config/projects /usr/share/nginx/
17
+ RUN chown www-data -R /usr/share/nginx/
18
+
19
+ # # Install SSH for a specific user (thanks to public key)
20
+ ADD ./private/id_rsa.pub /tmp/your_key
21
+ RUN cat /tmp/your_key >> /root/.ssh/authorized_keys && rm -f /tmp/your_key
22
+
23
+ # Add private key in order to get access to private repo
24
+ ADD ./private/id_rsa /root/.ssh/id_rsa
25
+
26
+ RUN apt-get clean && rm -rf /tmp/* /var/tmp/*
27
+
28
+ ADD ./config/sm-config /root/.symfony-manager/sm-config
29
+
30
+ RUN mkdir -p /etc/my_init.d
31
+ ADD setup-projects.sh /etc/my_init.d/setup-projects.sh
32
+
33
+ EXPOSE 80
34
+
35
+ CMD ["/sbin/my_init" ]
Original file line number Diff line number Diff line change
1
+ export DOCKER_DB_INSTANCE=$( sudo docker ps | grep " beaudev/mysql" | nawk ' {print $1}' )
2
+ export DB_PASS=$( sudo docker logs $DOCKER_DB_INSTANCE | grep " mysql -uadmin" | nawk ' {print $3}' | sed ' s/^-p//' )
3
+ export DB_HOST=` sudo docker inspect --format ' {{ .NetworkSettings.IPAddress }}' $DOCKER_DB_INSTANCE `
4
+ echo " Docker Mysql Instance:$DOCKER_DB_INSTANCE "
5
+ echo -e " Docker Mysql Details:\n\thost : $DB_HOST \n\tadmin pass:$DB_PASS "
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -x
3
+ SM_CONF_DIR=/root/.symfony-manager
4
+
5
+ source ~ /.bash-profile.d/bash-profile
6
+
7
+ if [ ! -d /root/config/sm-config ]; then
8
+ cp /root/config/sm-config $SM_CONF_DIR /sm-config
9
+
10
+ for file in ` ls $SM_CONF_DIR /sm-config`
11
+ do
12
+ source $SM_CONF_DIR /sm-config/$file
13
+ cat /tmp/default-symfony-nginx.conf | sed " s/__project_name__/$application_projectname /g;s#__project_path__#$application_install_path #g;s/__project_hosts__/$application_host =/g" > /etc/nginx/sites-available/project_$application_projectname .conf
14
+ ln -s /etc/nginx/sites-available/project_$application_projectname .conf /etc/nginx/sites-enabled/project_$application_projectname .conf
15
+ project_name=${file/ sm-config-}
16
+ # $SM_CONF_DIR/symfony_manager.sh -l $SM_CONF_DIR/sm-config/$file -fi
17
+ mkdir -p $application_install_path
18
+ done
19
+ fi
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
4
+
5
+ DB_HOST=${DB_HOST:- 127.0.0.1}
6
+ DB_USER=${DB_USER:- admin}
7
+ DB_PASS=${DB_PASS:- pass}
8
+
9
+ for file in ` find $DIR /config/projects -type f | grep -v orig`
10
+ do
11
+ sed ' s/###DB_HOST###/' $DB_HOST ' /g;s/###DB_USER###/' $DB_USER ' /g;s/###DB_PASS###/' $DB_PASS ' /g' < ${file} .orig > ${file}
12
+ done
You can’t perform that action at this time.
0 commit comments