forked from hozana/openchurch
/
Dockerfile
69 lines (55 loc) · 2.04 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
FROM php:7.1-apache
MAINTAINER Hozana team
# Add necesary libraries
RUN apt-get update \
&& apt-get upgrade -y --force-yes \
&& apt-get install -y --force-yes \
apt-transport-https \
curl \
git \
rsyslog \
supervisor \
# needed for nodejs:
gnupg \
# needed for php's zip extensions:
zlib1g-dev
# Add PHP extensions
RUN docker-php-ext-install mbstring pdo pdo_mysql zip
# Add Node.js for npm install
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get install -y --force-yes nodejs
RUN apt-get install -y --force-yes build-essential
# bugfix: remove cmdtest to install yarn correctly.
RUN apt-get remove -y cmdtest
# yarn package manager
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -y yarn
# add PECL extensions
# RUN pecl install xdebug && docker-php-ext-enable xdebug
# Configure PHP
COPY ./config/docker/php.ini /usr/local/etc/php/
# Configure Apache
COPY ./config/docker/apache-vhost.conf /etc/apache2/sites-available/openchurch.conf
RUN a2dissite 000-default.conf
RUN a2ensite openchurch
RUN a2enmod rewrite
RUN a2enmod headers
# Configure supervisord and syslog
RUN mkdir -p /var/log/supervisor
COPY ./config/docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY ./config/docker/rsyslog.conf /etc/rsyslog.conf
# Install Composer and make its cache directory world-writable
# as we will later run it under a local user id.
COPY ./config/docker/install_composer.sh /data/scripts/
RUN /data/scripts/install_composer.sh
RUN mkdir -p /.composer && chmod -R 777 /.composer
# Docker entrypoint
COPY ./config/docker/docker-entrypoint.sh /data/scripts/
ENTRYPOINT ["/data/scripts/docker-entrypoint.sh"]
#RUN mkdir -p /data/code
WORKDIR /var/www
VOLUME ["/var/www"]
EXPOSE 80 8000 3000
#Run supervisord to launch Apache
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]