forked from michaelmcandrew/civicrm-buildkit-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
147 lines (110 loc) · 3.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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# TODO: Consider switching to buster and relying more on civi-download-tools
# See https://github.com/michaelmcandrew/civicrm-buildkit-docker/issues/68#issuecomment-888224776
# for more details.
FROM php:7.4-apache-buster
# Install apt packages
#
# Required for php extensions
# * gd: libpng-dev, libjpeg62-turbo-dev
# * imagick: libmagickwand-dev
# * imap: libc-client-dev, libkrb5-dev
# * intl: libicu-dev
# * soap: libxml2-dev
# * zip: libzip-dev
#
# Used in the build process
# * default-mysql-client
# * git
# * nodejs
# * sudo
# * unzip
# * zip
#
# Other Utilities
# * bash-completion
# * iproute2 (required to get host ip from container)
# * msmtp-mta (for routing mail to maildev)
# * rsync
# * nano
# * vim
# * less
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apt-transport-https
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
bash-completion \
default-mysql-client \
git \
iproute2 \
less \
libc-client-dev \
libicu-dev \
libjpeg62-turbo-dev \
libkrb5-dev \
libmagickwand-dev \
libpng-dev \
libxml2-dev \
libzip-dev \
msmtp-mta \
nano \
nodejs \
rsync \
sudo \
unzip \
vim \
zip \
&& rm -r /var/lib/apt/lists/*
# Install php extensions (curl, json, mbstring, openssl, posix, phar
# are installed already and don't need to be specified here)
RUN docker-php-ext-install bcmath \
&& docker-php-ext-configure gd --with-jpeg \
&& docker-php-ext-install gd \
&& docker-php-ext-install gettext \
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
&& docker-php-ext-install imap \
&& docker-php-ext-install intl \
&& docker-php-ext-install mysqli \
&& docker-php-ext-install opcache \
&& docker-php-ext-install pdo_mysql \
&& docker-php-ext-install soap \
&& docker-php-ext-install zip
# Install and enable imagick PECL extensions
RUN pecl install imagick \
&& docker-php-ext-enable imagick
# Install xdebug PECL extension
RUN pecl install xdebug
RUN a2enmod rewrite
RUN a2enmod headers
ARG BUILDKIT_UID=1000
ARG BUILDKIT_GID=$BUILDKIT_UID
RUN addgroup --gid=$BUILDKIT_GID buildkit
RUN useradd --home-dir /buildkit --create-home --uid $BUILDKIT_UID --gid $BUILDKIT_GID buildkit
COPY sudo /etc/sudoers.d/buildkit
USER buildkit
WORKDIR /buildkit
ENV PATH="/buildkit/bin:${PATH}"
RUN git init . \
&& git remote add origin https://github.com/civicrm/civicrm-buildkit.git \
&& git pull origin master
# Need to create this before we configure apache, otherwise it will complain
RUN mkdir -p .amp/apache.d
RUN mkdir -p .cache/bower
RUN mkdir .composer
RUN mkdir .drush
RUN mkdir .npm
RUN civi-download-tools
RUN civibuild cache-warmup
COPY --chown=buildkit:buildkit amp.services.yml /buildkit/.amp/services.yml
COPY buildkit.ini /usr/local/etc/php/conf.d/buildkit.ini
COPY msmtprc /etc/msmtprc
COPY apache.conf /etc/apache2/conf-enabled/buildkit.conf
RUN rm /buildkit/app/civicrm.settings.d/100-mail.php
COPY civibuild.conf /buildkit/app/civibuild.conf
COPY apache24-vhost.php /buildkit/build/.amp/apache24-vhost.php
USER root
COPY ./docker-civicrm-entrypoint /usr/local/bin
RUN chmod u+x /usr/local/bin/docker-civicrm-entrypoint
ENTRYPOINT [ "docker-civicrm-entrypoint" ]
CMD ["apache2-foreground"]