Skip to content

Commit 76d0776

Browse files
committed
Add php.ini, mysql-config and install-composer files
1 parent b2404fd commit 76d0776

File tree

4 files changed

+50
-6
lines changed

4 files changed

+50
-6
lines changed

docker/Dockerfile

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,32 @@ RUN a2enmod rewrite
1010
RUN apt-get update && \
1111
apt-get install \
1212
libzip-dev \
13+
wget \
1314
git \
1415
unzip \
1516
-y --no-install-recommends
1617

1718
# Install PHP Extensions
1819
RUN docker-php-ext-install zip pdo_mysql
1920

20-
# Install composer
21-
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
22-
RUN php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
23-
RUN php composer-setup.php
24-
RUN php -r "unlink('composer-setup.php');"
25-
RUN mv composer.phar /usr/local/bin/composer
21+
# RUN pecl install -o -f xdebug-3.1.3 \
22+
# && rm -rf /tmp/pear
2623

24+
# Copy composer
25+
COPY ./install-composer.sh ./
26+
27+
# Copy php.ini
28+
COPY ./php.ini /usr/local/etc/php/
29+
30+
# Cleanup packages and install composer
31+
RUN apt-get purge -y g++ \
32+
&& apt-get autoremove -y \
33+
&& rm -r /var/lib/apt/lists/* \
34+
&& rm -rf /tmp/* \
35+
&& sh ./install-composer.sh \
36+
&& rm ./install-composer.sh
37+
38+
# Change the current working directory
2739
WORKDIR /var/www
2840

2941
# Change the owner of the container document root

docker/install-composer.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
3+
4+
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
5+
SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")
6+
EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig)
7+
8+
if [ "$EXPECTED_SIGNATURE" != "$SIGNATURE" ]
9+
then
10+
echo 'ERROR: Invalid installer signature'
11+
rm composer-setup.php
12+
exit 1
13+
fi
14+
15+
php composer-setup.php --quiet --install-dir=/usr/local/bin --filename=composer
16+
RESULT=$?
17+
rm composer-setup.php
18+
exit $RESULT

docker/mysql-config.conf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[client]
2+
default-character-set = utf8mb4
3+
4+
[mysql]
5+
default-character-set = utf8mb4
6+
7+
[mysqld]
8+
init-connect='SET NAMES utf8mb4'
9+
collation_server=utf8mb4_unicode_ci
10+
character_set_server=utf8mb4
11+
default_authentication_plugin= mysql_native_password

docker/php.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
; General
2+
upload_max_filesize = 200M
3+
post_max_size = 220M

0 commit comments

Comments
 (0)