forked from rossriley/docker-bolt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
60 lines (48 loc) · 2.26 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
FROM ubuntu:16.04
MAINTAINER Ross Riley "[email protected]"
# Install nginx
ENV HOME /root
RUN apt-get update && apt-get install -y nginx supervisor curl git
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
RUN locale-gen en_US.UTF-8 && \
echo 'LANG="en_US.utf-8"' > /etc/default/locale
RUN dpkg-reconfigure locales
# Install PHP7 and modules along with composer binary
RUN apt-get -y install php7.0-fpm php7.0-pgsql php7.0-mcrypt php7.0-curl php7.0-gd php7.0-json php7.0-cli php-ssh2 php7.0-sqlite php7.0-mbstring php7.0-xml
RUN sed -i -e "s/short_open_tag = Off/short_open_tag = On/g" /etc/php/7.0/fpm/php.ini
RUN sed -i -e "s/post_max_size = 8M/post_max_size = 20M/g" /etc/php/7.0/fpm/php.ini
RUN sed -i -e "s/upload_max_filesize = 2M/upload_max_filesize = 20M/g" /etc/php/7.0/fpm/php.ini
RUN curl -sS https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer
# Configure nginx for PHP websites
RUN mkdir /var/run/php
RUN echo "cgi.fix_pathinfo = 0;" >> /etc/php/7.0/fpm/php.ini
RUN echo "max_input_vars = 10000;" >> /etc/php/7.0/fpm/php.ini
RUN echo "date.timezone = Europe/London;" >> etc/php/7.0/fpm/php.ini
# Setup supervisor
COPY supervisor/nginx.conf /etc/supervisor/conf.d/
COPY supervisor/php.conf /etc/supervisor/conf.d/
COPY supervisor/user.conf /etc/supervisor/conf.d/
# Disallow key checking
RUN echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config
# Adds the default server to nginx config
COPY config/nginx.conf /etc/nginx/sites-available/default
# Internal Port Expose
EXPOSE 80 443
COPY ./ /var/www/
RUN chmod +x /var/www/start.sh
RUN chmod -R 0777 /var/www/public
RUN cd /var/www/ && composer update
RUN mkdir -p /var/www/app/config
RUN chmod -R 0777 /var/www/app
RUN cd /var/www/ && vendor/bin/nut database:update
RUN cd /var/www/ && vendor/bin/nut user:add admin Admin [email protected] password root
RUN mkdir -p /var/www/public/theme
RUN mkdir -p /var/www/public/extensions
RUN mkdir -p /var/www/public/files
RUN chmod -R 0777 /var/www/public/extensions
RUN chmod -R 0777 /var/www/public/files
RUN cp -r /var/www/vendor/bolt/bolt/files/* /var/www/public/files/
RUN ln -sf /var/www/vendor/bolt/bolt/theme/base-2016 /var/www/public/theme/base-2016
RUN ln -sf /var/www/vendor/bolt/bolt/theme /var/www/theme
CMD ["/usr/bin/supervisord", "-n"]