-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
54 lines (36 loc) · 2 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
FROM debian:latest
MAINTAINER [email protected]
ARG user
ARG uid
RUN apt-get update && \
apt-get install apt-utils -y
RUN adduser --disabled-password --gecos "" -u $uid $user
RUN echo 'mysql-server mysql-server/root_password password r00t' | debconf-set-selections && \
echo 'mysql-server mysql-server/root_password_again password r00t'| debconf-set-selections && \
apt-get install mysql-server -y && \
/etc/init.d/mysql stop
RUN apt-get install php5 php5-mysql git wget curl php5-curl php5-intl phpunit vim -y && \
/etc/init.d/mysql start && \
echo "CREATE DATABASE timegrid_dev CHARACTER SET utf8 COLLATE utf8_general_ci; GRANT ALL ON timegrid_dev.* TO 'timegrid_dev'@localhost IDENTIFIED BY 'tgpass';" | mysql -pr00t && \
echo "CREATE DATABASE testing_timegrid CHARACTER SET utf8 COLLATE utf8_general_ci; GRANT ALL ON testing_timegrid.* TO 'testing_timegrid'@localhost IDENTIFIED BY 'testing_timegrid';" | mysql -pr00t && \
/etc/init.d/mysql stop
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
WORKDIR /var/www
RUN mkdir timegrid && chown $user:www-data timegrid && \
echo "* * * * * php /var/www/timegrid/artisan schedule:run >> /dev/null 2>&1" >> /etc/crontab
USER $user
RUN git clone https://github.com/timegridio/timegrid
WORKDIR /var/www/timegrid
RUN cp .env.example .env && mkdir /tmp/timegrid_storage && \
sed -i -e 's/^DB_HOST.*/DB_HOST="127.0.0.1"/g' -e 's/^DB_DATABASE.*/DB_DATABASE="timegrid_dev"/g' -e 's/^DB_USERNAME.*/DB_USERNAME="timegrid_dev"/g' -e 's/^DB_PASSWORD.*/DB_PASSWORD="tgpass"/g' -e 's/^STORAGE_PATH=.*/STORAGE_PATH="\/tmp\/timegrid_storage"/g' .env
RUN composer install --no-interaction
USER root:root
RUN /etc/init.d/mysql start && \
php artisan migrate --seed --database=testing && \
php artisan key:generate && \
php artisan migrate && \
php artisan db:seed && \
php artisan geoip:update && \
/etc/init.d/mysql stop
CMD /etc/init.d/mysql start && tail -f /dev/null
EXPOSE 8000