-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
93 lines (70 loc) · 2.78 KB
/
Dockerfile
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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
# Symfony 1.4
#
# VERSION 1.0
# use the ubuntu base image provided by dotCloud
FROM ubuntu
MAINTAINER awwa, [email protected]
# copy config file for mysql
ADD files/my.cnf /etc/mysql/my.cnf
# make sure the package repository is up to date
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
# install apache2
RUN apt-get -y install apache2
# install php
RUN apt-get -y install php5
RUN apt-get -y install libapache2-mod-php5
# hack for not start mysql-server cause of /sbin/initctl
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -s /bin/true /sbin/initctl
# install mysql
RUN apt-get install -y -o Dpkg::Options::="--force-confold" mysql-common
RUN DEBIAN_FRONTEND=noninteractive apt-get install -q -y mysql-server
RUN apt-get install -y libapache2-mod-auth-mysql php5-mysql
# config for root login from remote
RUN (/usr/bin/mysqld_safe &); sleep 5; echo "grant all privileges on *.* to root@'%';" | mysql -u root # -ppassword
#CMD ["/usr/bin/mysqld_safe"]
# install subversion
RUN apt-get -y install subversion
# create directory for libs
RUN mkdir -p /home/sfproject/lib/vendor
# install symfony via svn
RUN cd /home/sfproject/lib/vendor
RUN svn checkout http://svn.symfony-project.com/branches/1.4/ /home/sfproject/lib/vendor/symfony
# copy script create symfony
ADD files/symfony_create_project.sh /home/sfproject/symfony_create_project.sh
RUN chmod +x /home/sfproject/symfony_create_project.sh
# create project
RUN /home/sfproject/symfony_create_project.sh
# apache2 configuration
ADD files/apache2_conf.sh /home/sfproject/apache2_conf.sh
RUN chmod +x /home/sfproject/apache2_conf.sh
RUN /home/sfproject/apache2_conf.sh
# environment value
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
# add config for swift_mailer
ADD files/factories_yml.sh /home/sfproject/factories_yml.sh
RUN chmod +x /home/sfproject/factories_yml.sh
RUN /home/sfproject/factories_yml.sh
# add code for send mail example
ADD files/index.php /home/sfproject/web/index.php
# install ssh for maintainance
RUN apt-get install -y openssh-server
RUN mkdir -p /var/run/sshd
#RUN useradd -d /home/hoge -m -s /bin/bash hoge
RUN echo root:password | chpasswd
RUN echo 'rootpass ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# install editor tool
RUN apt-get -y install less
RUN apt-get -y install vim
ADD files/myEmail.class.php /home/sfproject/apps/frontend/lib/myEmail.class.php
ADD files/app.yml /home/sfproject/apps/frontend/config/app.yml
ADD files/_registrationHTML.php /home/sfproject/apps/frontend/modules/mail/_registrationHTML.php
ADD files/_registrationTEXT.php /home/sfproject/apps/frontend/modules/mail/_registrationTEXT.php
# expose http & ssh port
EXPOSE 8080
EXPOSE 22
#
#CMD ["/usr/sbin/apache2", "-D", "FOREGROUND"]