Skip to content
This repository was archived by the owner on Mar 15, 2019. It is now read-only.

Commit 9aea86b

Browse files
author
Julien Neuhart
authored
switching to images (#27)
1 parent 9a041ea commit 9aea86b

File tree

8 files changed

+34
-208
lines changed

8 files changed

+34
-208
lines changed
Lines changed: 4 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,13 @@
1-
FROM php:7.1.7-fpm-alpine
2-
3-
# |--------------------------------------------------------------------------
4-
# | Main PHP extensions
5-
# |--------------------------------------------------------------------------
6-
# |
7-
# | Installs the main PHP extensions
8-
# |
9-
10-
RUN apk add --no-cache --virtual .persistent-deps \
11-
libjpeg \
12-
libjpeg-turbo \
13-
libjpeg-turbo-dev \
14-
libpng \
15-
libpng-dev \
16-
freetype \
17-
freetype-dev \
18-
icu \
19-
icu-dev \
20-
libmcrypt \
21-
libmcrypt-dev
22-
23-
RUN set -xe &&\
24-
apk add --no-cache --virtual .build-deps &&\
25-
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ &&\
26-
docker-php-ext-configure bcmath --enable-bcmath &&\
27-
docker-php-ext-configure intl --enable-intl &&\
28-
docker-php-ext-configure mbstring --enable-mbstring &&\
29-
docker-php-ext-configure mcrypt --enable-mcrypt &&\
30-
docker-php-ext-configure pdo_mysql --with-pdo-mysql &&\
31-
docker-php-ext-configure opcache --enable-opcache &&\
32-
docker-php-ext-configure zip --enable-zip &&\
33-
docker-php-ext-install \
34-
bcmath \
35-
intl \
36-
mbstring \
37-
mcrypt \
38-
pdo_mysql \
39-
opcache \
40-
zip
41-
42-
# |--------------------------------------------------------------------------
43-
# | APCu extension
44-
# |--------------------------------------------------------------------------
45-
# |
46-
# | Installs the APCu extension for PHP.
47-
# |
48-
49-
ENV APCU_VERSION 5.1.8
50-
51-
RUN mkdir -p /usr/src/php/ext/apcu &&\
52-
curl -L https://github.com/krakjoe/apcu/archive/v$APCU_VERSION.tar.gz | tar xvz -C /usr/src/php/ext/apcu --strip 1 &&\
53-
echo 'apcu' >> /usr/src/php-available-exts &&\
54-
docker-php-ext-install apcu
1+
FROM gulnap/kickoff-docker-php-images:php-fpm-7.1.8-0
552

563
# |--------------------------------------------------------------------------
574
# | PHP extension for Redis
585
# |--------------------------------------------------------------------------
596
# |
60-
# | Installs the Redis extension for PHP. Also tells PHP to use it as the
61-
# | session handler.
7+
# | Tells PHP to use Redis as the session handler.
628
# |
639

64-
ENV PHPREDIS_VERSION 3.1.3
65-
66-
RUN mkdir -p /usr/src/php/ext/redis &&\
67-
curl -L https://github.com/phpredis/phpredis/archive/$PHPREDIS_VERSION.tar.gz | tar xvz -C /usr/src/php/ext/redis --strip 1 &&\
68-
echo 'redis' >> /usr/src/php-available-exts &&\
69-
docker-php-ext-install redis &&\
70-
{ \
10+
RUN { \
7111
echo 'session.save_handler=redis'; \
7212
echo 'session.save_path="tcp://redis:6379?auth={{ .EnvFiles.Kickoff.REDIS_PASSWORD }}"'; \
7313
} >> /usr/local/etc/php/conf.d/docker-php-ext-redis.ini
@@ -93,16 +33,4 @@ RUN mkdir -p /usr/src/php/ext/xdebug &&\
9333
echo 'xdebug.remote_handler=dbgp'; \
9434
echo 'xdebug.remote_connect_back=0'; \
9535
} >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
96-
{{ end }}
97-
98-
# |--------------------------------------------------------------------------
99-
# | Permissions issues workaround
100-
# |--------------------------------------------------------------------------
101-
# |
102-
# | Installs 3.6 repositories and shadow package to enable usermod command.
103-
# | On Linux, the entrypoint of this container will set the UID of www-data
104-
# | with the UID of the current user from the host.
105-
# |
106-
107-
RUN echo http://dl-2.alpinelinux.org/alpine/v3.6/community/ >> /etc/apk/repositories &&\
108-
apk --no-cache add shadow
36+
{{ end }}

.docker/toolbox/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
conf.d/memory-limit.ini
22
generated/graylog/.env
3-
generated/traefik
3+
generated/traefik/certs/*.crt
4+
generated/traefik/certs/*.key
45
Dockerfile
Lines changed: 4 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,148 +1,24 @@
1-
FROM php:7.1.7-alpine
2-
3-
# |--------------------------------------------------------------------------
4-
# | Main PHP extensions
5-
# |--------------------------------------------------------------------------
6-
# |
7-
# | Installs the main PHP extensions
8-
# |
9-
10-
RUN apk add --no-cache --virtual .persistent-deps \
11-
libjpeg \
12-
libjpeg-turbo \
13-
libjpeg-turbo-dev \
14-
libpng \
15-
libpng-dev \
16-
freetype \
17-
freetype-dev \
18-
icu \
19-
icu-dev \
20-
libmcrypt \
21-
libmcrypt-dev
22-
23-
RUN set -xe &&\
24-
apk add --no-cache --virtual .build-deps &&\
25-
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ &&\
26-
docker-php-ext-configure bcmath --enable-bcmath &&\
27-
docker-php-ext-configure intl --enable-intl &&\
28-
docker-php-ext-configure mbstring --enable-mbstring &&\
29-
docker-php-ext-configure mcrypt --enable-mcrypt &&\
30-
docker-php-ext-configure pdo_mysql --with-pdo-mysql &&\
31-
docker-php-ext-configure opcache --enable-opcache &&\
32-
docker-php-ext-configure zip --enable-zip &&\
33-
docker-php-ext-install \
34-
bcmath \
35-
intl \
36-
mbstring \
37-
mcrypt \
38-
pdo_mysql \
39-
opcache \
40-
zip
41-
42-
# |--------------------------------------------------------------------------
43-
# | APCu extension
44-
# |--------------------------------------------------------------------------
45-
# |
46-
# | Installs the APCu extension for PHP.
47-
# |
48-
49-
ENV APCU_VERSION 5.1.8
50-
51-
RUN mkdir -p /usr/src/php/ext/apcu &&\
52-
curl -L https://github.com/krakjoe/apcu/archive/v$APCU_VERSION.tar.gz | tar xvz -C /usr/src/php/ext/apcu --strip 1 &&\
53-
echo 'apcu' >> /usr/src/php-available-exts &&\
54-
docker-php-ext-install apcu
1+
FROM gulnap/kickoff-docker-php-images:toolbox-7.1.8-1
552

563
# |--------------------------------------------------------------------------
574
# | PHP extension for Redis
585
# |--------------------------------------------------------------------------
596
# |
60-
# | Installs the Redis extension for PHP. Also tells PHP to use it as the
61-
# | session handler.
7+
# | Tells PHP to use Redis as the session handler.
628
# |
639

64-
ENV PHPREDIS_VERSION 3.1.3
65-
66-
RUN mkdir -p /usr/src/php/ext/redis &&\
67-
curl -L https://github.com/phpredis/phpredis/archive/$PHPREDIS_VERSION.tar.gz | tar xvz -C /usr/src/php/ext/redis --strip 1 &&\
68-
echo 'redis' >> /usr/src/php-available-exts &&\
69-
docker-php-ext-install redis &&\
70-
{ \
10+
RUN { \
7111
echo 'session.save_handler=redis'; \
7212
echo 'session.save_path="tcp://redis:6379?auth={{ .EnvFiles.Kickoff.REDIS_PASSWORD }}"'; \
7313
} >> /usr/local/etc/php/conf.d/docker-php-ext-redis.ini
7414

75-
# |--------------------------------------------------------------------------
76-
# | 3.6 repositories
77-
# |--------------------------------------------------------------------------
78-
# |
79-
# | Installs the 3.6 repositories, as some packages are not available by
80-
# | default in the current version of Alpine used by the PHP image.
81-
# |
82-
83-
RUN echo http://dl-2.alpinelinux.org/alpine/v3.6/main/ >> /etc/apk/repositories &&\
84-
echo http://dl-2.alpinelinux.org/alpine/v3.6/community/ >> /etc/apk/repositories
85-
86-
# |--------------------------------------------------------------------------
87-
# | OpenSSL
88-
# |--------------------------------------------------------------------------
89-
# |
90-
# | Installs openssl command, which is required for generating the self-signed
91-
# | certificate and the .htdigest file.
92-
# |
93-
94-
RUN apk --no-cache add openssl
95-
96-
# |--------------------------------------------------------------------------
97-
# | Composer
98-
# |--------------------------------------------------------------------------
99-
# |
100-
# | Installs Composer and Git to easily manage your PHP dependencies.
101-
# |
102-
103-
ENV COMPOSER_VERSION 1.5.0
104-
105-
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --version=$COMPOSER_VERSION &&\
106-
chmod +x /usr/local/bin/composer &&\
107-
apk --no-cache add git
108-
109-
# |--------------------------------------------------------------------------
110-
# | PHP Coding Standards Fixer
111-
# |--------------------------------------------------------------------------
112-
# |
113-
# | The PHP Coding Standards Fixer tool fixes most issues in your code when
114-
# | you want to follow the PHP coding standards as defined in the PSR-1 and
115-
# | PSR-2 documents and many more.
116-
# |
117-
118-
ENV PHP_CS_FIXER_VERSION 2.4.0
119-
120-
RUN curl -L http://cs.sensiolabs.org/download/php-cs-fixer-v$PHP_CS_FIXER_VERSION.phar -o php-cs-fixer &&\
121-
chmod a+x php-cs-fixer &&\
122-
mv php-cs-fixer /usr/local/bin/php-cs-fixer
123-
124-
# |--------------------------------------------------------------------------
125-
# | NodeJS
126-
# |--------------------------------------------------------------------------
127-
# |
128-
# | Installs NodeJS, npm and yarn. The later will allow you to easily manage
129-
# | your frontend dependencies.
130-
# |
131-
132-
ENV NODE_VERSION 6.10.3-r1
133-
134-
RUN apk --no-cache add nodejs=$NODE_VERSION nodejs-npm=$NODE_VERSION &&\
135-
npm install -g yarn
136-
13715
# |--------------------------------------------------------------------------
13816
# | Permissions issues workaround
13917
# |--------------------------------------------------------------------------
14018
# |
141-
# | Installs shadow package to enable usermod command.
14219
# | On Linux, the UID arg will be set with the UID of the current user
14320
# | from the host.
14421
# |
14522

14623
ARG UID=1000
147-
RUN apk --no-cache add shadow &&\
148-
usermod -u $UID www-data
24+
RUN usermod -u $UID www-data

.docker/toolbox/generated/traefik/certs/.gitkeep

Whitespace-only changes.

.docker/toolbox/scripts/traefik-self-signed-certificate.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/bin/sh
22

33
if [ ! -f "/generated/traefik/certs/$VIRTUAL_HOST.key" ]; then
4-
rm -rf /certs/*;
4+
rm -rf /certs/*.crt;
5+
rm -rf /certs/*.key;
56
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout /generated/traefik/certs/$VIRTUAL_HOST.key -out /generated/traefik/certs/$VIRTUAL_HOST.crt -days 365 -subj "/C=FR/ST=PARIS/L=PARIS/O=Kickoff/OU=Kickoff/CN=*.$VIRTUAL_HOST";
67
else
78
echo Self-signed certificate already generated, skipping ...;

.env.blueprint

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ REDIS_PASSWORD=secret
110110
# |
111111
# | The password of the user defined in the "kickoff.yml" file.
112112
# |
113+
# | Note: it will only be set the first time the RabbitMQ container is launched.
114+
# | If you want to update it after, use the RabbitMQ dashboard. You could also
115+
# | delete the RabbitMQ named volume, but proceed with caution: it will also
116+
# | delete all your queues, messages and so on.
117+
# |
113118

114119
RABBITMQ_PASSWORD=secret
115120

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ If you're interested, you can still take a look at the [first version](https://g
3939
* A powerful **reverse-proy** ([Traefik](https://traefik.io/)) which can handle automatic HTTPS (via [Let's Encrypt](https://letsencrypt.org/))
4040
on your production environment
4141
* **Performance gains** on Mac and Windows using [Docker Sync](http://docker-sync.io/) or Docker for Mac's user-guided cache
42+
* **Lightweight** images, mostly based on Alpine
4243
* **Customizable** thanks to [Orbit](https://github.com/gulien/orbit)
4344

4445
And more to come! :smiley:
@@ -111,7 +112,11 @@ Now open your hosts file...
111112
127.0.0.1 graylog.my-awesome-project.local
112113
```
113114

114-
**Tip:** don't want to update your hosts file? Set `project.virtualhost.local` to `my-awesome-project.127.0.0.1.xip.io` in your `kickoff.yml` file. You're application will be available under https://www.my-awesome-project.127.0.0.1.xip.io/!
115+
**Note:** Set `project.virtualhost.local` with your own virtual host in your `kickoff.yml` file, unless you wish to use
116+
`my-awesome-project.local` of course :smile:.
117+
118+
**Tip:** don't want to update your hosts file? Set `project.virtualhost.local` with `my-awesome-project.127.0.0.1.xip.io`
119+
in your `kickoff.yml` file. You're application will be available under https://www.my-awesome-project.127.0.0.1.xip.io/!
115120

116121
Good :smiley:? We're now done with the configuration! :metal:
117122

@@ -288,7 +293,8 @@ have to update it according to the PHP framework you wish to use.
288293

289294
Your PHP application will be accessible under https://my-awesome-project.local/ and https://www.my-awesome-project.local/.
290295

291-
**Installed PHP extensions:** apcu, bcmath, gd, intl, mbstring, mcrypt, pdo_mysql, phpredis, opcache, xdebug (`local` environement only!) and zip
296+
**Installed PHP extensions:** apcu, bcmath, gd, intl, mbstring, mcrypt, pdo_mysql, phpredis, opcache,
297+
xdebug (`local` environement only!), soap and zip
292298

293299
#### Configuration
294300

@@ -361,6 +367,10 @@ You may access to the RabbitMQ dashboard (https://rabbitmq.my-awesome-project.lo
361367
| rabbitmq.user | `kickoff.yml` | The RabbitMQ user of your PHP application. |
362368
| RABBITMQ_PASSWORD | `.env` | The password of the user defined in the `kickoff.yml` file. |
363369

370+
**Note:** the credentials will only be set the first time the RabbitMQ container is launched. If you want to update them
371+
after, use the RabbitMQ dashboard. You could also delete the RabbitMQ named volume, but proceed with caution: it will also
372+
delete all your queues, messages and so on.
373+
364374
## Contributing
365375

366376
Please read our [contributing guidelines](.github/CONTRIBUTING.md) for instructions.

kickoff.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,10 @@ rabbitmq:
9292
# |
9393
# | The RabbitMQ user of your PHP application.
9494
# |
95+
# | Note: it will only be set the first time the RabbitMQ container is launched.
96+
# | If you want to update it after, use the RabbitMQ dashboard. You could also
97+
# | delete the RabbitMQ named volume, but proceed with caution: it will also
98+
# | delete all your queues, messages and so on.
99+
# |
95100

96101
user: kickoff

0 commit comments

Comments
 (0)