Skip to content

Commit a83af42

Browse files
committed
Merge branch 'release/0.1.0'
2 parents 95c7784 + 3357595 commit a83af42

23 files changed

+532
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/kickass

.travis.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
sudo: required
2+
services:
3+
- docker
4+
5+
env:
6+
DOCKER_COMPOSE_VERSION: 1.7.1
7+
8+
script:
9+
- docker-compose --file docker-compose-build.yml up -d --build
10+
- docker-compose --file docker-compose-build.yml run web nginx -t
11+
- docker-compose --file docker-compose-build.yml run fpm php -v
12+
- docker-compose --file docker-compose-build.yml run cli php -v
13+
- docker-compose --file docker-compose-build.yml run cli kickass-installer

7.1-cli/Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# FPM, PHP 7.1, KickAssCommerce compatible container.
2+
3+
FROM php:7.1-cli
4+
5+
MAINTAINER Adam Paterson <hello@adampaterson.co.uk>
6+
7+
# Install PHP extension dependancies
8+
RUN apt-get update \
9+
&& apt-get install -y \
10+
libicu-dev \
11+
libmcrypt-dev \
12+
libxslt1-dev \
13+
zlib1g-dev \
14+
git
15+
16+
# Install required PHP extensions
17+
RUN docker-php-ext-install \
18+
intl \
19+
mbstring \
20+
mcrypt \
21+
xsl \
22+
zip \
23+
soap
24+
25+
# Install PHP7 compatible version of xdebug
26+
RUN pecl install -o -f xdebug-2.4.0
27+
28+
# Install composer
29+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
30+
31+
# Define volume for caching composer packages
32+
VOLUME /root/.composer/cache
33+
34+
# Add executables and config
35+
ADD bin/* /usr/local/bin/
36+
ADD etc/php.ini /usr/local/etc/php/conf.d/zz-kickass.ini
37+
ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug.ini
38+
39+
# Define default environment variables
40+
ENV PHP_MEMORY_LIMIT 2G
41+
ENV PHP_ENABLE_XDEBUG false
42+
ENV APP_ROOT /var/www/kickass
43+
44+
ENTRYPOINT ["/usr/local/bin/docker-environment"]
45+
CMD ["bash"]

7.1-cli/bin/docker-environment

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
# Ensure our Kickass directory exists
4+
mkdir -p $APP_ROOT
5+
chown www-data:www-data $APP_ROOT
6+
7+
# Configure PHP
8+
[ ! -z "${PHP_MEMORY_LIMIT}" ] && sed -i "s/!PHP_MEMORY_LIMIT!/${PHP_MEMORY_LIMIT}/" /usr/local/etc/php/conf.d/zz-kickass.ini
9+
10+
[ "$PHP_ENABLE_XDEBUG" = "true" ] && \
11+
docker-php-ext-enable xdebug && \
12+
echo "Xdebug is enabled"
13+
14+
exec "$@"

7.1-cli/bin/kickass-installer

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
if [ ! -f "$APP_ROOT/composer.json" ]; then
4+
echo "Creating KickAssCommerce ($KICKASS_VERSION) project"
5+
6+
composer create-project \
7+
kickasscommerce/kickasscommerce=$KICKASS_VERSION \
8+
--no-interaction \
9+
$APP_ROOT
10+
else
11+
echo "KickAssCommerce installation found in $APP_ROOT, installing composer dependencies"
12+
composer --working-dir=$APP_ROOT install
13+
fi
14+
15+
echo "Installation complete"

7.1-cli/etc/php-xdebug.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
; Xdebug settings are only relevent if the Xdebug module is loaded
2+
3+
xdebug.remote_enable = 1
4+
xdebug.remote_connect_back = 1
5+
xdebug.remote_port = 9000
6+
7+
xdebug.scream = 0
8+
xdebug.show_local_vars = 1
9+
10+
xdebug.idekey = PHPSTORM

7.1-cli/etc/php.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
memory_limit = !PHP_MEMORY_LIMIT! ; Variable: PHP_MEMORY_LIMIT

7.1-fpm/Dockerfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# FPM, PHP 7.1, KickAssCommerce compatible container.
2+
3+
FROM php:7.1-fpm
4+
5+
MAINTAINER Adam Paterson <hello@adampaterson.co.uk>
6+
7+
# Install PHP extension dependancies
8+
RUN apt-get update \
9+
&& apt-get install -y \
10+
libicu-dev \
11+
libmcrypt-dev \
12+
libxslt1-dev \
13+
zlib1g-dev
14+
15+
# Install required PHP extensions
16+
RUN docker-php-ext-install \
17+
intl \
18+
mbstring \
19+
mcrypt \
20+
xsl \
21+
zip
22+
23+
# Install PHP7 compatible version of xdebug
24+
RUN pecl install -o -f xdebug-2.5.0
25+
26+
# Define volume for caching composer packages
27+
VOLUME /roo/.composer/cache
28+
29+
# Add executables and config
30+
ADD bin/docker-environment /usr/local/bin/
31+
ADD etc/php.ini /usr/local/etc/php/conf.d/zz-kickass.ini
32+
ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug.ini
33+
ADD etc/php-fpm.conf /usr/local/etc/
34+
35+
# Define default environment variables
36+
ENV PHP_MEMORY_LIMIT 2G
37+
ENV PHP_ENABLE_XDEBUG false
38+
ENV APP_ROOT /var/www/kickass
39+
40+
ENTRYPOINT ["/usr/local/bin/docker-environment"]
41+
CMD ["php-fpm", "-F"]

7.1-fpm/bin/docker-environment

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# Configure PHP
4+
[ ! -z "${PHP_MEMORY_LIMIT}" ] && sed -i "s/!PHP_MEMORY_LIMIT!/${PHP_MEMORY_LIMIT}/" /usr/local/etc/php/conf.d/zz-kickass.ini
5+
6+
[ "$PHP_ENABLE_XDEBUG" = "true" ] && \
7+
docker-php-ext-enable xdebug && \
8+
echo "Xdebug is enabled"
9+
10+
exec "$@"

7.1-fpm/etc/php-fpm.conf

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[global]
2+
3+
error_log = /proc/self/fd/2
4+
daemonize = no
5+
6+
[www]
7+
access.log = /proc/self/fd/2
8+
9+
user = www-data
10+
group = www-data
11+
12+
listen = [::]:9000
13+
14+
pm = dynamic
15+
pm.max_children = 10
16+
pm.start_servers = 4
17+
pm.min_spare_servers = 2
18+
pm.max_spare_servers = 6
19+
20+
clear_env = no
21+
22+
; Ensure stdout and stderr are sent to the main error log
23+
catch_workers_output = yes

0 commit comments

Comments
 (0)