Initial commit
This commit is contained in:
commit
71b4e88c07
78
README.md
Normal file
78
README.md
Normal file
@ -0,0 +1,78 @@
|
||||
|
||||
# EnvDev Dockerfiles
|
||||
Web Developement Environment (Apache, PHP, MariaDB, ...)
|
||||
|
||||
# List
|
||||
* HTTPd
|
||||
* PHP-FPM
|
||||
* MariaDB
|
||||
* Redis
|
||||
* MailCatcher
|
||||
* MailDev
|
||||
* PHP-Cli
|
||||
|
||||
# Docker Engine
|
||||
|
||||
## Install
|
||||
Mac: https://docs.docker.com/docker-for-mac/install/
|
||||
Windows: https://docs.docker.com/docker-for-windows/install/
|
||||
Ubuntu: https://docs.docker.com/install/linux/docker-ce/ubuntu/
|
||||
|
||||
# Docker compose
|
||||
https://github.com/docker/compose/releases
|
||||
|
||||
# Usage
|
||||
Start with a docker-compose file
|
||||
|
||||
We hope you have define a workspace path
|
||||
Linux: ```/home/<user>/workspace```
|
||||
Windows: ```C:\<user>\worspace```
|
||||
|
||||
## Launch services (first time build)
|
||||
```bash
|
||||
docker-compose up -d
|
||||
```
|
||||
Delete service : `docker-compose rm`
|
||||
|
||||
## Start and stop
|
||||
`docker-compose start`
|
||||
`docker-compose stop`
|
||||
|
||||
## Viewing log
|
||||
`docker-compose logs -f`
|
||||
`docker-compose logs <container_name>`
|
||||
|
||||
## View running container
|
||||
|
||||
|
||||
## Update or Re-create base image
|
||||
|
||||
|
||||
# Specific container usage
|
||||
|
||||
## PHP Cli
|
||||
Work in your vhosts to execute some command in php
|
||||
```bash
|
||||
docker-compose exec -u fpm <container_name>
|
||||
|
||||
```
|
||||
To avoid permissions problem
|
||||
|
||||
Update composer or an admin command
|
||||
```bash
|
||||
docker-compose exec <container_name>
|
||||
```
|
||||
|
||||
## Database
|
||||
Database files are store in <workspace>/database.
|
||||
Even if you delete your
|
||||
|
||||
|
||||
# Additional
|
||||
## ctop
|
||||
Get ctop on [github](https://github.com/bcicen/ctop)
|
||||
|
||||
```bash
|
||||
sudo wget https://github.com/bcicen/ctop/releases/download/v0.7.1/ctop-0.7.1-linux-amd64 -O /usr/local/bin/ctop
|
||||
sudo chmod +x /usr/local/bin/ctop
|
||||
```
|
19
additional/install_composer.sh
Normal file
19
additional/install_composer.sh
Normal file
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig)
|
||||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")
|
||||
|
||||
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
|
||||
then
|
||||
>&2 echo 'ERROR: Invalid installer signature'
|
||||
rm composer-setup.php
|
||||
exit 1
|
||||
fi
|
||||
|
||||
php composer-setup.php --quiet
|
||||
RESULT=$?
|
||||
rm composer-setup.php
|
||||
mv composer.phar /usr/local/bin/composer
|
||||
chmod +x /usr/local/bin/composer
|
||||
exit $RESULT
|
79
docker-compose.yml
Normal file
79
docker-compose.yml
Normal file
@ -0,0 +1,79 @@
|
||||
version: '2.1'
|
||||
services:
|
||||
# PHP 5.6 FPM
|
||||
fpm56:
|
||||
container_name: fpm56
|
||||
image: php-fpm:5.6-debian
|
||||
volumes:
|
||||
- /home/michael/workspace:/home/vhosts
|
||||
links:
|
||||
- "db:db"
|
||||
- "mailcatcher:mailcatcher"
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "1g"
|
||||
max-file: "10"
|
||||
# PHP 7.0 FPM
|
||||
fpm70:
|
||||
container_name: fpm70
|
||||
image: php-fpm:7.0-debian
|
||||
volumes:
|
||||
- /home/michael/workspace:/home/vhosts
|
||||
links:
|
||||
- "db:db"
|
||||
- "mailcatcher:mailcatcher"
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "1g"
|
||||
max-file: "10"
|
||||
# MailCatcher
|
||||
mailcatcher:
|
||||
container_name: mailcatcher
|
||||
image: mailcatcher:0.6.5
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "1g"
|
||||
max-file: "10"
|
||||
# MariaDB
|
||||
db:
|
||||
container_name: db
|
||||
image: mariadb:10.2-debian
|
||||
user: mysql
|
||||
volumes:
|
||||
- /home/michael/workspace/database:/var/lib/mysql
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "500m"
|
||||
max-file: "9"
|
||||
environment:
|
||||
MARIADB_PASS: password
|
||||
# Apache HTTPd
|
||||
httpd:
|
||||
container_name: httpd
|
||||
image: httpd:2.4-debian
|
||||
volumes:
|
||||
- /home/michael/workspace:/home/vhosts
|
||||
links:
|
||||
- "fpm56:fpm56"
|
||||
- "fpm70:fpm70"
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "1g"
|
||||
max-file: "10"
|
||||
networks:
|
||||
front:
|
||||
ipv4_address: 172.10.0.2
|
||||
|
||||
networks:
|
||||
front:
|
||||
driver: bridge
|
||||
ipam:
|
||||
driver: default
|
||||
config:
|
||||
- subnet: 172.10.0.0/16
|
||||
gateway: 172.10.0.1
|
201
dockerfiles/LICENSE
Normal file
201
dockerfiles/LICENSE
Normal file
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
11
dockerfiles/README.md
Normal file
11
dockerfiles/README.md
Normal file
@ -0,0 +1,11 @@
|
||||
# EnvDev Dockerfiles
|
||||
Web Developement Environment (Apache, PHP, MariaDB, ...)
|
||||
|
||||
# List
|
||||
* HTTPd
|
||||
* MailCatcher
|
||||
* MailDev
|
||||
* MariaDB
|
||||
* PHP-Cli
|
||||
* PHP-FPM
|
||||
* Redis
|
77
dockerfiles/docker-compose.example.yml
Normal file
77
dockerfiles/docker-compose.example.yml
Normal file
@ -0,0 +1,77 @@
|
||||
version: '2.1'
|
||||
services:
|
||||
# PHP 7.0 FPM
|
||||
dev-fpm70:
|
||||
container_name: dev-fpm70
|
||||
image: envdev/php-fpm:7.0-debian
|
||||
volumes:
|
||||
- /path/to/workspace:/home/vhosts
|
||||
links:
|
||||
- "dev-db:db"
|
||||
- "dev-redis:redis"
|
||||
- "dev-mailcatcher:mailcatcher"
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "1g"
|
||||
max-file: "10"
|
||||
environment:
|
||||
LOCAL_USER_ID: 1000
|
||||
# MailCatcher
|
||||
dev-mailcatcher:
|
||||
container_name: dev-mailcatcher
|
||||
image: envdev/mailcatcher:0.6.5
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "1g"
|
||||
max-file: "10"
|
||||
# MailCatcher
|
||||
dev-redis:
|
||||
container_name: dev-redis
|
||||
image: envdev/redis:4.0
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "1g"
|
||||
max-file: "10"
|
||||
# MariaDB
|
||||
dev-db:
|
||||
container_name: dev-db
|
||||
image: envdev/mariadb:10.2-debian
|
||||
user: mysql
|
||||
volumes:
|
||||
- /path/to/workspace/database:/var/lib/mysql
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "500m"
|
||||
max-file: "9"
|
||||
environment:
|
||||
MARIADB_PASS: password
|
||||
# Apache HTTPd
|
||||
dev-httpd:
|
||||
container_name: dev-httpd
|
||||
image: envdev/httpd:2.4-debian
|
||||
volumes:
|
||||
- /path/to/workspace:/home/vhosts
|
||||
links:
|
||||
- "dev-fpm70:fpm70"
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "1g"
|
||||
max-file: "10"
|
||||
networks:
|
||||
default:
|
||||
front:
|
||||
ipv4_address: 172.10.0.2
|
||||
|
||||
networks:
|
||||
front:
|
||||
driver: bridge
|
||||
ipam:
|
||||
driver: default
|
||||
config:
|
||||
- subnet: 172.10.0.0/16
|
||||
gateway: 172.10.0.1
|
28
dockerfiles/httpd/2.4/debian-9/Dockerfile
Normal file
28
dockerfiles/httpd/2.4/debian-9/Dockerfile
Normal file
@ -0,0 +1,28 @@
|
||||
FROM debian:9
|
||||
|
||||
# Environment
|
||||
ENV TERM xterm
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV TZ=Europe/Paris
|
||||
|
||||
# Installation
|
||||
RUN apt-get update && apt-get -y upgrade && apt-get -y dist-upgrade && \
|
||||
apt-get -y install nano apache2 libapache2-mod-xsendfile && \
|
||||
echo "ServerName 127.0.0.1" > /etc/apache2/conf-available/httpd.conf && \
|
||||
mkdir /var/run/apache2 && mkdir /var/lock/apache2 && \
|
||||
rm -f /var/log/apache2/error.log && ln -s /dev/stderr /var/log/apache2/error.log && \
|
||||
rm -f /var/log/apache2/access.log && ln -s /dev/stdout /var/log/apache2/access.log
|
||||
|
||||
RUN perl /usr/sbin/a2enconf httpd
|
||||
RUN perl /usr/sbin/a2enmod autoindex deflate expires headers rewrite actions proxy proxy_fcgi
|
||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ADD run.sh /run.sh
|
||||
RUN chmod +x /run.sh
|
||||
|
||||
# Add VOLUMEs
|
||||
VOLUME ["/home/vhosts"]
|
||||
|
||||
# Expose and Run
|
||||
EXPOSE 80
|
||||
CMD ["/run.sh"]
|
8
dockerfiles/httpd/2.4/debian-9/run.sh
Normal file
8
dockerfiles/httpd/2.4/debian-9/run.sh
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Apache gets grumpy about PID files pre-existing
|
||||
rm -f /usr/local/apache2/logs/httpd.pid
|
||||
|
||||
source /etc/apache2/envvars
|
||||
exec apache2 -D FOREGROUND
|
28
dockerfiles/httpd/2.4/ubuntu-16.04/Dockerfile
Normal file
28
dockerfiles/httpd/2.4/ubuntu-16.04/Dockerfile
Normal file
@ -0,0 +1,28 @@
|
||||
FROM ubuntu:16.04
|
||||
|
||||
# Environment
|
||||
ENV TERM xterm
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV TZ=Europe/Paris
|
||||
|
||||
# Installation
|
||||
RUN apt-get update && apt-get -y upgrade && apt-get -y dist-upgrade && \
|
||||
apt-get -y install nano apache2 libapache2-mod-fcgid libapache2-mod-rpaf libapache2-mod-xsendfile && \
|
||||
echo "ServerName 127.0.0.1" > /etc/apache2/conf-available/httpd.conf && \
|
||||
mkdir /var/run/apache2 && mkdir /var/lock/apache2 && \
|
||||
rm -f /var/log/apache2/error.log && ln -s /dev/stderr /var/log/apache2/error.log && \
|
||||
rm -f /var/log/apache2/access.log && ln -s /dev/stdout /var/log/apache2/access.log
|
||||
|
||||
RUN perl /usr/sbin/a2enconf httpd
|
||||
RUN perl /usr/sbin/a2enmod autoindex deflate expires headers rewrite actions proxy proxy_fcgi rpaf
|
||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ADD run.sh /run.sh
|
||||
RUN chmod +x /run.sh
|
||||
|
||||
# Add VOLUMEs
|
||||
VOLUME ["/home/vhosts"]
|
||||
|
||||
# Expose and Run
|
||||
EXPOSE 80
|
||||
CMD ["/run.sh"]
|
8
dockerfiles/httpd/2.4/ubuntu-16.04/run.sh
Normal file
8
dockerfiles/httpd/2.4/ubuntu-16.04/run.sh
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Apache gets grumpy about PID files pre-existing
|
||||
rm -f /usr/local/apache2/logs/httpd.pid
|
||||
|
||||
source /etc/apache2/envvars
|
||||
exec apache2 -D FOREGROUND
|
39
dockerfiles/httpd/README.md
Normal file
39
dockerfiles/httpd/README.md
Normal file
@ -0,0 +1,39 @@
|
||||
# Build
|
||||
```
|
||||
$ docker build --force-rm --no-cache -t envdev/httpd:<version>-<distrib> httpd/<version>/<distrib>/
|
||||
```
|
||||
|
||||
# Usage
|
||||
## Configure Vhosts
|
||||
|
||||
## php-fpm
|
||||
Create a file `/etc/apache2/sites-enabled/fpm/70.conf` and add in your vhost
|
||||
`include fpm/70.conf`
|
||||
|
||||
```
|
||||
# Redirect to local php-fpm if mod_php is not available
|
||||
<IfModule !mod_php7.c>
|
||||
<IfModule proxy_fcgi_module>
|
||||
# Enable http authorization headers
|
||||
<IfModule setenvif_module>
|
||||
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
|
||||
</IfModule>
|
||||
|
||||
<FilesMatch ".+\.ph(p[3457]?|t|tml)$">
|
||||
SetHandler "proxy:fcgi://fpm70/:9000
|
||||
</FilesMatch>
|
||||
<FilesMatch ".+\.phps$">
|
||||
# Deny access to raw php sources by default
|
||||
# To re-enable it's recommended to enable access to the files
|
||||
# only in specific virtual host or directory
|
||||
Require all denied
|
||||
</FilesMatch>
|
||||
# Deny access to files without filename (e.g. '.php')
|
||||
<FilesMatch "^\.ph(p[3457]?|t|tml|ps)$">
|
||||
Require all denied
|
||||
</FilesMatch>
|
||||
</IfModule>
|
||||
</IfModule>
|
||||
```
|
||||
|
||||
Adapt to any version of PHP-FPM you have
|
14
dockerfiles/mailcatcher/Dockerfile
Normal file
14
dockerfiles/mailcatcher/Dockerfile
Normal file
@ -0,0 +1,14 @@
|
||||
FROM alpine:latest
|
||||
|
||||
ENV VERSION 0.6.5
|
||||
ENV HTTP_PORT 1080
|
||||
ENV SMTP_PORT 1025
|
||||
|
||||
RUN apk add --update ruby ruby-dev ruby-bigdecimal sqlite sqlite-dev build-base libstdc++ ca-certificates && \
|
||||
gem install json --no-ri --no-rdoc && \
|
||||
gem install mailcatcher -v $VERSION --no-ri --no-rdoc && \
|
||||
apk del --purge ruby-dev build-base && \
|
||||
rm -rf /var/cache/apk/*
|
||||
|
||||
EXPOSE $SMTP_PORT $HTTP_PORT
|
||||
CMD mailcatcher -f --ip=0.0.0.0 --smtp-port=$SMTP_PORT --http-port=$HTTP_PORT
|
16
dockerfiles/mailcatcher/README.md
Normal file
16
dockerfiles/mailcatcher/README.md
Normal file
@ -0,0 +1,16 @@
|
||||
# Mailcatcher
|
||||
|
||||
[Mailcatcher](http://mailcatcher.me) catches mail and serves it through a dream.
|
||||
|
||||
Deliver mails to smtp://127.0.0.1:1025 et check out [http://127.0.0.1:1080]() to see them.
|
||||
|
||||
## Environment variables
|
||||
**SMTP_PORT** Change default SMTP port (default: 1025)
|
||||
|
||||
**HTTP_PORT** Change default HTTP port (default: 1080)
|
||||
|
||||
## Usage with PHP
|
||||
sudo nano /etc/php5/apache2/php.ini
|
||||
sudo nano /etc/php5/cli/php.ini
|
||||
|
||||
sendmail_path = /usr/bin/env catchmail --smtp-ip 172.18.0.1 --smtp-port 1025 -f some@from.address
|
7
dockerfiles/maildev/README.md
Normal file
7
dockerfiles/maildev/README.md
Normal file
@ -0,0 +1,7 @@
|
||||
MailDev
|
||||
=======
|
||||
|
||||
[MailDev](http://danfarrelly.nyc/MailDev/)
|
||||
|
||||
> $ docker pull djfarrelly/maildev
|
||||
> $ docker run -p 1080:80 -p 1025:25 djfarrelly/maildev
|
33
dockerfiles/mariadb/10.0/ubuntu-14.04/Dockerfile
Normal file
33
dockerfiles/mariadb/10.0/ubuntu-14.04/Dockerfile
Normal file
@ -0,0 +1,33 @@
|
||||
FROM ubuntu:14.04
|
||||
|
||||
ENV TERM xterm
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
# Installation
|
||||
RUN apt-get -y install software-properties-common && \
|
||||
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db && \
|
||||
add-apt-repository 'deb [arch=amd64,i386] http://mirror6.layerjet.com/mariadb/repo/10.0/ubuntu trusty main' && \
|
||||
apt-get update && apt-get -y upgrade && apt-get install -y mariadb-server-10.0 pwgen && \
|
||||
rm -rf /var/lib/mysql/* && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
sed -i -e 's/log_bin[ \t]*= \/var\/log\/mysql\/mariadb-bin/#log_bin[ \t]*= \/var\/log\/mysql\/mariadb-bin/g' /etc/mysql/my.cnf && \
|
||||
sed -i -e 's/log_bin_index[ \t]*= \/var\/log\/mysql\/mariadb-bin.index/#log_bin_index[ \t]*= \/var\/log\/mysql\/mariadb-bin.index/g' /etc/mysql/my.cnf && \
|
||||
sed -i -r 's/syslog/log_error=\/var\/log\/errorlog.err/' /etc/mysql/conf.d/mysqld_safe_syslog.cnf && \
|
||||
ln -s /dev/stderr /var/log/errorlog.err && \
|
||||
echo "Europe/Paris" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
|
||||
|
||||
# Add MySQL configuration
|
||||
ADD *.cnf /etc/mysql/conf.d/
|
||||
RUN chmod 644 /etc/mysql/conf.d/*.cnf
|
||||
|
||||
# Add cli to run
|
||||
ADD init_user.sh /home/init_user.sh
|
||||
ADD run.sh /home/run.sh
|
||||
RUN chmod 775 /home/*.sh
|
||||
|
||||
# Add VOLUMEs to allow backup of config and databases
|
||||
VOLUME ["/etc/mysql", "/var/lib/mysql"]
|
||||
|
||||
EXPOSE 3306
|
||||
CMD ["/home/run.sh"]
|
32
dockerfiles/mariadb/10.0/ubuntu-14.04/init_user.sh
Normal file
32
dockerfiles/mariadb/10.0/ubuntu-14.04/init_user.sh
Normal file
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
/usr/bin/mysqld_safe > /dev/null 2>&1 &
|
||||
|
||||
RET=1
|
||||
while [[ RET -ne 0 ]]; do
|
||||
echo "=> Waiting for confirmation of MariaDB service startup"
|
||||
sleep 5
|
||||
mysql -uroot -e "status" > /dev/null 2>&1
|
||||
RET=$?
|
||||
done
|
||||
|
||||
|
||||
PASS=${MARIADB_PASS:-$(pwgen -s 12 1)}
|
||||
_word=$( [ ${MARIADB_PASS} ] && echo "preset" || echo "random" )
|
||||
echo "=> Creating MariaDB admin user with ${_word} password"
|
||||
|
||||
mysql -uroot -e "CREATE USER 'admin'@'%' IDENTIFIED BY '$PASS'"
|
||||
mysql -uroot -e "GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION"
|
||||
|
||||
echo "=> Done!"
|
||||
|
||||
echo "========================================================================"
|
||||
echo "You can now connect to this MariaDB Server using:"
|
||||
echo ""
|
||||
echo " mysql -uadmin -p$PASS -h<host> -P<port>"
|
||||
echo ""
|
||||
echo "Please remember to change the above password as soon as possible!"
|
||||
echo "MariaDB user 'root' has no password but only allows local connections"
|
||||
echo "========================================================================"
|
||||
|
||||
mysqladmin -uroot shutdown
|
6
dockerfiles/mariadb/10.0/ubuntu-14.04/my.cnf
Normal file
6
dockerfiles/mariadb/10.0/ubuntu-14.04/my.cnf
Normal file
@ -0,0 +1,6 @@
|
||||
[mysqld]
|
||||
bind-address=0.0.0.0
|
||||
skip_name_resolve
|
||||
skip_external_locking
|
||||
#server-id
|
||||
#log-bin
|
17
dockerfiles/mariadb/10.0/ubuntu-14.04/run.sh
Normal file
17
dockerfiles/mariadb/10.0/ubuntu-14.04/run.sh
Normal file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
VOLUME_HOME="/var/lib/mysql"
|
||||
|
||||
if [[ ! -d $VOLUME_HOME/mysql ]]; then
|
||||
echo "=> An empty or uninitialized MariaDB volume is detected in $VOLUME_HOME"
|
||||
echo "=> Installing MariaDB ..."
|
||||
mysql_install_db > /dev/null 2>&1
|
||||
echo "=> Done!"
|
||||
/home/init_user.sh
|
||||
else
|
||||
echo "=> Using an existing volume of MariaDB"
|
||||
fi
|
||||
|
||||
/home/init_config.sh
|
||||
|
||||
exec mysqld_safe
|
32
dockerfiles/mariadb/10.1/ubuntu-14.04/Dockerfile
Normal file
32
dockerfiles/mariadb/10.1/ubuntu-14.04/Dockerfile
Normal file
@ -0,0 +1,32 @@
|
||||
FROM ubuntu:14.04
|
||||
|
||||
ENV TERM xterm
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
# Installation
|
||||
RUN apt-get update && apt-get -y install software-properties-common && \
|
||||
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db && \
|
||||
add-apt-repository 'deb [arch=amd64,i386] http://ftp.igh.cnrs.fr/pub/mariadb/repo/10.1/ubuntu trusty main' && \
|
||||
apt-get update && apt-get -y upgrade && apt-get -y install mariadb-server-10.1 pwgen && \
|
||||
rm -rf /var/lib/mysql/* && \
|
||||
sed -i -e 's/log_bin[ \t]*= \/var\/log\/mysql\/mariadb-bin/#log_bin[ \t]*= \/var\/log\/mysql\/mariadb-bin/g' /etc/mysql/my.cnf && \
|
||||
sed -i -e 's/log_bin_index[ \t]*= \/var\/log\/mysql\/mariadb-bin.index/#log_bin_index[ \t]*= \/var\/log\/mysql\/mariadb-bin.index/g' /etc/mysql/my.cnf && \
|
||||
sed -i -r 's/syslog/log_error=\/var\/log\/errorlog.err/' /etc/mysql/conf.d/mysqld_safe_syslog.cnf && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
||||
ln -s /dev/stderr /var/log/errorlog.err && \
|
||||
echo "Europe/Paris" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
|
||||
|
||||
# Add MySQL configuration
|
||||
ADD *.cnf /etc/mysql/conf.d/
|
||||
RUN chmod 644 /etc/mysql/conf.d/*.cnf
|
||||
|
||||
# Add cli to run
|
||||
ADD init_user.sh /home/init_user.sh
|
||||
ADD run.sh /home/run.sh
|
||||
RUN chmod 775 /home/*.sh
|
||||
|
||||
# Add VOLUMEs to allow backup of config and databases
|
||||
VOLUME ["/etc/mysql", "/var/lib/mysql"]
|
||||
|
||||
EXPOSE 3306
|
||||
CMD ["/home/run.sh"]
|
32
dockerfiles/mariadb/10.1/ubuntu-14.04/init_user.sh
Normal file
32
dockerfiles/mariadb/10.1/ubuntu-14.04/init_user.sh
Normal file
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
/usr/bin/mysqld_safe > /dev/null 2>&1 &
|
||||
|
||||
RET=1
|
||||
while [[ RET -ne 0 ]]; do
|
||||
echo "=> Waiting for confirmation of MariaDB service startup"
|
||||
sleep 5
|
||||
mysql -uroot -e "status" > /dev/null 2>&1
|
||||
RET=$?
|
||||
done
|
||||
|
||||
|
||||
PASS=${MARIADB_PASS:-$(pwgen -s 12 1)}
|
||||
_word=$( [ ${MARIADB_PASS} ] && echo "preset" || echo "random" )
|
||||
echo "=> Creating MariaDB admin user with ${_word} password"
|
||||
|
||||
mysql -uroot -e "CREATE USER 'admin'@'%' IDENTIFIED BY '$PASS'"
|
||||
mysql -uroot -e "GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION"
|
||||
|
||||
echo "=> Done!"
|
||||
|
||||
echo "========================================================================"
|
||||
echo "You can now connect to this MariaDB Server using:"
|
||||
echo ""
|
||||
echo " mysql -uadmin -p$PASS -h<host> -P<port>"
|
||||
echo ""
|
||||
echo "Please remember to change the above password as soon as possible!"
|
||||
echo "MariaDB user 'root' has no password but only allows local connections"
|
||||
echo "========================================================================"
|
||||
|
||||
mysqladmin -uroot shutdown
|
6
dockerfiles/mariadb/10.1/ubuntu-14.04/my.cnf
Normal file
6
dockerfiles/mariadb/10.1/ubuntu-14.04/my.cnf
Normal file
@ -0,0 +1,6 @@
|
||||
[mysqld]
|
||||
bind-address=0.0.0.0
|
||||
skip_name_resolve
|
||||
skip_external_locking
|
||||
#server-id
|
||||
#log-bin
|
15
dockerfiles/mariadb/10.1/ubuntu-14.04/run.sh
Normal file
15
dockerfiles/mariadb/10.1/ubuntu-14.04/run.sh
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
VOLUME_HOME="/var/lib/mysql"
|
||||
|
||||
if [[ ! -d $VOLUME_HOME/mysql ]]; then
|
||||
echo "=> An empty or uninitialized MariaDB volume is detected in $VOLUME_HOME"
|
||||
echo "=> Installing MariaDB ..."
|
||||
mysql_install_db > /dev/null 2>&1
|
||||
echo "=> Done!"
|
||||
/home/init_user.sh
|
||||
else
|
||||
echo "=> Using an existing volume of MariaDB"
|
||||
fi
|
||||
|
||||
exec mysqld_safe
|
33
dockerfiles/mariadb/10.2/debian/Dockerfile
Normal file
33
dockerfiles/mariadb/10.2/debian/Dockerfile
Normal file
@ -0,0 +1,33 @@
|
||||
FROM debian:9
|
||||
|
||||
# Environment
|
||||
ENV TERM xterm
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV TZ=Europe/Paris
|
||||
|
||||
# Installation
|
||||
RUN apt-get update && apt-get -y install software-properties-common procps gnupg pwgen nano && \
|
||||
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 && \
|
||||
add-apt-repository 'deb [arch=amd64] http://ftp.igh.cnrs.fr/pub/mariadb/repo/10.2/debian stretch main' && \
|
||||
apt-get update && apt-get -y upgrade && apt-get -y install mariadb-server-10.2 && \
|
||||
sed -i -e 's/log_bin[ \t]*= \/var\/log\/mysql\/mariadb-bin/#log_bin[ \t]*= \/var\/log\/mysql\/mariadb-bin/g' /etc/mysql/my.cnf && \
|
||||
sed -i -e 's/log_bin_index[ \t]*= \/var\/log\/mysql\/mariadb-bin.index/#log_bin_index[ \t]*= \/var\/log\/mysql\/mariadb-bin.index/g' /etc/mysql/my.cnf && \
|
||||
ln -s /dev/stderr /var/log/errorlog.err && chown mysql: /var/lib/mysql && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
||||
echo "Europe/Paris" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
|
||||
|
||||
# Add MySQL configuration
|
||||
ADD *.cnf /etc/mysql/conf.d/
|
||||
RUN chmod 644 /etc/mysql/conf.d/*.cnf
|
||||
|
||||
# Add cli to run
|
||||
ADD init_user.sh /home/init_user.sh
|
||||
ADD run.sh /home/run.sh
|
||||
RUN chmod 775 /home/*.sh
|
||||
|
||||
# Add VOLUMEs to allow backup of config and databases
|
||||
VOLUME ["/etc/mysql", "/var/lib/mysql"]
|
||||
|
||||
# Expose and Run
|
||||
EXPOSE 3306
|
||||
CMD ["/home/run.sh"]
|
32
dockerfiles/mariadb/10.2/debian/init_user.sh
Normal file
32
dockerfiles/mariadb/10.2/debian/init_user.sh
Normal file
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
/usr/bin/mysqld_safe > /dev/null 2>&1 &
|
||||
|
||||
RET=1
|
||||
while [[ RET -ne 0 ]]; do
|
||||
echo "=> Waiting for confirmation of MariaDB service startup"
|
||||
sleep 5
|
||||
mysql -uroot -e "status" > /dev/null 2>&1
|
||||
RET=$?
|
||||
done
|
||||
|
||||
|
||||
PASS=${MARIADB_PASS:-$(pwgen -s 12 1)}
|
||||
_word=$( [ ${MARIADB_PASS} ] && echo "preset" || echo "random" )
|
||||
echo "=> Creating MariaDB admin user with ${_word} password"
|
||||
|
||||
mysql -uroot -e "CREATE USER 'admin'@'%' IDENTIFIED BY '$PASS'"
|
||||
mysql -uroot -e "GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION"
|
||||
|
||||
echo "=> Done!"
|
||||
|
||||
echo "========================================================================"
|
||||
echo "You can now connect to this MariaDB Server using:"
|
||||
echo ""
|
||||
echo " mysql -uadmin -p$PASS -h<host> -P<port>"
|
||||
echo ""
|
||||
echo "Please remember to change the above password as soon as possible!"
|
||||
echo "MariaDB user 'root' has no password but only allows local connections"
|
||||
echo "========================================================================"
|
||||
|
||||
mysqladmin -uroot shutdown
|
8
dockerfiles/mariadb/10.2/debian/my.cnf
Normal file
8
dockerfiles/mariadb/10.2/debian/my.cnf
Normal file
@ -0,0 +1,8 @@
|
||||
[mysqld]
|
||||
bind-address=0.0.0.0
|
||||
skip-host-cache
|
||||
skip_name_resolve
|
||||
skip_external_locking
|
||||
log_error=/var/log/errorlog.err
|
||||
#server-id
|
||||
#log-bin
|
15
dockerfiles/mariadb/10.2/debian/run.sh
Normal file
15
dockerfiles/mariadb/10.2/debian/run.sh
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
VOLUME_HOME="/var/lib/mysql"
|
||||
|
||||
if [[ ! -d $VOLUME_HOME/mysql ]]; then
|
||||
echo "=> An empty or uninitialized MariaDB volume is detected in $VOLUME_HOME"
|
||||
echo "=> Installing MariaDB ..."
|
||||
mysql_install_db > /dev/null 2>&1
|
||||
echo "=> Done!"
|
||||
/home/init_user.sh
|
||||
else
|
||||
echo "=> Using an existing volume of MariaDB"
|
||||
fi
|
||||
|
||||
exec mysqld_safe
|
25
dockerfiles/mariadb/10.2/official/Dockerfile
Normal file
25
dockerfiles/mariadb/10.2/official/Dockerfile
Normal file
@ -0,0 +1,25 @@
|
||||
FROM mariadb:10.2
|
||||
|
||||
# Environment
|
||||
ENV TERM xterm
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV TZ=Europe/Paris
|
||||
|
||||
# Installation
|
||||
RUN apt-get update && apt-get -y install software-properties-common gnupg procps nano pwgen && \
|
||||
echo "Europe/Paris" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
|
||||
|
||||
# Add MySQL configuration
|
||||
ADD *.cnf /etc/mysql/conf.d/
|
||||
RUN chmod 644 /etc/mysql/conf.d/*.cnf
|
||||
|
||||
# Add cli to run
|
||||
ADD init_user.sh /home/init_user.sh
|
||||
RUN chmod 775 /home/*.sh
|
||||
|
||||
# Add VOLUMEs to allow backup of config and databases
|
||||
VOLUME ["/etc/mysql", "/var/lib/mysql"]
|
||||
|
||||
# Expose and Run
|
||||
EXPOSE 3306
|
||||
CMD ["mysqld"]
|
32
dockerfiles/mariadb/10.2/official/init_user.sh
Normal file
32
dockerfiles/mariadb/10.2/official/init_user.sh
Normal file
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
/usr/bin/mysqld_safe > /dev/null 2>&1 &
|
||||
|
||||
RET=1
|
||||
while [[ RET -ne 0 ]]; do
|
||||
echo "=> Waiting for confirmation of MariaDB service startup"
|
||||
sleep 5
|
||||
mysql -uroot -e "status" > /dev/null 2>&1
|
||||
RET=$?
|
||||
done
|
||||
|
||||
|
||||
PASS=${MARIADB_PASS:-$(pwgen -s 12 1)}
|
||||
_word=$( [ ${MARIADB_PASS} ] && echo "preset" || echo "random" )
|
||||
echo "=> Creating MariaDB admin user with ${_word} password"
|
||||
|
||||
mysql -uroot -e "CREATE USER 'admin'@'%' IDENTIFIED BY '$PASS'"
|
||||
mysql -uroot -e "GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION"
|
||||
|
||||
echo "=> Done!"
|
||||
|
||||
echo "========================================================================"
|
||||
echo "You can now connect to this MariaDB Server using:"
|
||||
echo ""
|
||||
echo " mysql -uadmin -p$PASS -h<host> -P<port>"
|
||||
echo ""
|
||||
echo "Please remember to change the above password as soon as possible!"
|
||||
echo "MariaDB user 'root' has no password but only allows local connections"
|
||||
echo "========================================================================"
|
||||
|
||||
mysqladmin -uroot shutdown
|
8
dockerfiles/mariadb/10.2/official/my.cnf
Normal file
8
dockerfiles/mariadb/10.2/official/my.cnf
Normal file
@ -0,0 +1,8 @@
|
||||
[mysqld]
|
||||
bind-address=0.0.0.0
|
||||
skip-host-cache
|
||||
skip_name_resolve
|
||||
skip_external_locking
|
||||
log_error=/var/log/errorlog.err
|
||||
#server-id
|
||||
#log-bin
|
35
dockerfiles/mariadb/10.2/ubuntu/Dockerfile
Normal file
35
dockerfiles/mariadb/10.2/ubuntu/Dockerfile
Normal file
@ -0,0 +1,35 @@
|
||||
FROM ubuntu:16.04
|
||||
|
||||
# Environment
|
||||
ENV TERM xterm
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV TZ=Europe/Paris
|
||||
|
||||
# Installation
|
||||
RUN apt-get update && apt-get -y install software-properties-common pwgen && \
|
||||
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db && \
|
||||
add-apt-repository 'deb [arch=amd64,i386] http://ftp.igh.cnrs.fr/pub/mariadb/repo/10.2/ubuntu xenial main' && \
|
||||
apt-get update && apt-get -y upgrade && apt-get -y install mariadb-server-10.2 && \
|
||||
rm -rf /var/lib/mysql/* && \
|
||||
sed -i -e 's/log_bin[ \t]*= \/var\/log\/mysql\/mariadb-bin/#log_bin[ \t]*= \/var\/log\/mysql\/mariadb-bin/g' /etc/mysql/my.cnf && \
|
||||
sed -i -e 's/log_bin_index[ \t]*= \/var\/log\/mysql\/mariadb-bin.index/#log_bin_index[ \t]*= \/var\/log\/mysql\/mariadb-bin.index/g' /etc/mysql/my.cnf && \
|
||||
sed -i -r 's/syslog/log_error=\/var\/log\/errorlog.err/' /etc/mysql/conf.d/mysqld_safe_syslog.cnf && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
||||
ln -s /dev/stderr /var/log/errorlog.err && \
|
||||
echo "Europe/Paris" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
|
||||
|
||||
# Add MySQL configuration
|
||||
ADD *.cnf /etc/mysql/conf.d/
|
||||
RUN chmod 644 /etc/mysql/conf.d/*.cnf
|
||||
|
||||
# Add cli to run
|
||||
ADD init_user.sh /home/init_user.sh
|
||||
ADD run.sh /home/run.sh
|
||||
RUN chmod 775 /home/*.sh
|
||||
|
||||
# Add VOLUMEs to allow backup of config and databases
|
||||
VOLUME ["/etc/mysql", "/var/lib/mysql"]
|
||||
|
||||
# Expose and Run
|
||||
EXPOSE 3306
|
||||
CMD ["/home/run.sh"]
|
32
dockerfiles/mariadb/10.2/ubuntu/init_user.sh
Normal file
32
dockerfiles/mariadb/10.2/ubuntu/init_user.sh
Normal file
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
/usr/bin/mysqld_safe > /dev/null 2>&1 &
|
||||
|
||||
RET=1
|
||||
while [[ RET -ne 0 ]]; do
|
||||
echo "=> Waiting for confirmation of MariaDB service startup"
|
||||
sleep 5
|
||||
mysql -uroot -e "status" > /dev/null 2>&1
|
||||
RET=$?
|
||||
done
|
||||
|
||||
|
||||
PASS=${MARIADB_PASS:-$(pwgen -s 12 1)}
|
||||
_word=$( [ ${MARIADB_PASS} ] && echo "preset" || echo "random" )
|
||||
echo "=> Creating MariaDB admin user with ${_word} password"
|
||||
|
||||
mysql -uroot -e "CREATE USER 'admin'@'%' IDENTIFIED BY '$PASS'"
|
||||
mysql -uroot -e "GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION"
|
||||
|
||||
echo "=> Done!"
|
||||
|
||||
echo "========================================================================"
|
||||
echo "You can now connect to this MariaDB Server using:"
|
||||
echo ""
|
||||
echo " mysql -uadmin -p$PASS -h<host> -P<port>"
|
||||
echo ""
|
||||
echo "Please remember to change the above password as soon as possible!"
|
||||
echo "MariaDB user 'root' has no password but only allows local connections"
|
||||
echo "========================================================================"
|
||||
|
||||
mysqladmin -uroot shutdown
|
7
dockerfiles/mariadb/10.2/ubuntu/my.cnf
Normal file
7
dockerfiles/mariadb/10.2/ubuntu/my.cnf
Normal file
@ -0,0 +1,7 @@
|
||||
[mysqld]
|
||||
bind-address=0.0.0.0
|
||||
skip-host-cache
|
||||
skip_name_resolve
|
||||
skip_external_locking
|
||||
#server-id
|
||||
#log-bin
|
15
dockerfiles/mariadb/10.2/ubuntu/run.sh
Normal file
15
dockerfiles/mariadb/10.2/ubuntu/run.sh
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
VOLUME_HOME="/var/lib/mysql"
|
||||
|
||||
if [[ ! -d $VOLUME_HOME/mysql ]]; then
|
||||
echo "=> An empty or uninitialized MariaDB volume is detected in $VOLUME_HOME"
|
||||
echo "=> Installing MariaDB ..."
|
||||
mysql_install_db > /dev/null 2>&1
|
||||
echo "=> Done!"
|
||||
/home/init_user.sh
|
||||
else
|
||||
echo "=> Using an existing volume of MariaDB"
|
||||
fi
|
||||
|
||||
exec mysqld_safe
|
32
dockerfiles/mariadb/5.5/ubuntu-14.04/Dockerfile
Normal file
32
dockerfiles/mariadb/5.5/ubuntu-14.04/Dockerfile
Normal file
@ -0,0 +1,32 @@
|
||||
FROM ubuntu:14.04
|
||||
|
||||
ENV TERM xterm
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
# Installation
|
||||
RUN apt-get update && apt-get -y install software-properties-common && \
|
||||
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db && \
|
||||
add-apt-repository 'deb [arch=amd64,i386] http://ftp.igh.cnrs.fr/pub/mariadb/repo/5.5/ubuntu trusty main' && \
|
||||
apt-get update && apt-get -y upgrade && apt-get -y install mariadb-server-5.5 pwgen && \
|
||||
rm -rf /var/lib/mysql/* && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
||||
sed -i -e 's/log_bin[ \t]*= \/var\/log\/mysql\/mariadb-bin/#log_bin[ \t]*= \/var\/log\/mysql\/mariadb-bin/g' /etc/mysql/my.cnf && \
|
||||
sed -i -e 's/log_bin_index[ \t]*= \/var\/log\/mysql\/mariadb-bin.index/#log_bin_index[ \t]*= \/var\/log\/mysql\/mariadb-bin.index/g' /etc/mysql/my.cnf && \
|
||||
sed -i -r 's/syslog/log_error=\/var\/log\/errorlog.err/' /etc/mysql/conf.d/mysqld_safe_syslog.cnf && \
|
||||
ln -s /dev/stderr /var/log/errorlog.err && \
|
||||
echo "Europe/Paris" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
|
||||
|
||||
# Add MySQL configuration
|
||||
ADD *.cnf /etc/mysql/conf.d/
|
||||
RUN chmod 644 /etc/mysql/conf.d/*.cnf
|
||||
|
||||
# Add cli to run
|
||||
ADD init_user.sh /home/init_user.sh
|
||||
ADD run.sh /home/run.sh
|
||||
RUN chmod 775 /home/*.sh
|
||||
|
||||
# Add VOLUMEs to allow backup of config and databases
|
||||
VOLUME ["/etc/mysql", "/var/lib/mysql"]
|
||||
|
||||
EXPOSE 3306
|
||||
CMD ["/home/run.sh"]
|
32
dockerfiles/mariadb/5.5/ubuntu-14.04/init_user.sh
Normal file
32
dockerfiles/mariadb/5.5/ubuntu-14.04/init_user.sh
Normal file
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
/usr/bin/mysqld_safe > /dev/null 2>&1 &
|
||||
|
||||
RET=1
|
||||
while [[ RET -ne 0 ]]; do
|
||||
echo "=> Waiting for confirmation of MariaDB service startup"
|
||||
sleep 5
|
||||
mysql -uroot -e "status" > /dev/null 2>&1
|
||||
RET=$?
|
||||
done
|
||||
|
||||
|
||||
PASS=${MARIADB_PASS:-$(pwgen -s 12 1)}
|
||||
_word=$( [ ${MARIADB_PASS} ] && echo "preset" || echo "random" )
|
||||
echo "=> Creating MariaDB admin user with ${_word} password"
|
||||
|
||||
mysql -uroot -e "CREATE USER 'admin'@'%' IDENTIFIED BY '$PASS'"
|
||||
mysql -uroot -e "GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION"
|
||||
|
||||
echo "=> Done!"
|
||||
|
||||
echo "========================================================================"
|
||||
echo "You can now connect to this MariaDB Server using:"
|
||||
echo ""
|
||||
echo " mysql -uadmin -p$PASS -h<host> -P<port>"
|
||||
echo ""
|
||||
echo "Please remember to change the above password as soon as possible!"
|
||||
echo "MariaDB user 'root' has no password but only allows local connections"
|
||||
echo "========================================================================"
|
||||
|
||||
mysqladmin -uroot shutdown
|
6
dockerfiles/mariadb/5.5/ubuntu-14.04/my.cnf
Normal file
6
dockerfiles/mariadb/5.5/ubuntu-14.04/my.cnf
Normal file
@ -0,0 +1,6 @@
|
||||
[mysqld]
|
||||
bind-address=0.0.0.0
|
||||
skip-name-resolve
|
||||
skip_external_locking
|
||||
#server-id
|
||||
#log-bin
|
15
dockerfiles/mariadb/5.5/ubuntu-14.04/run.sh
Normal file
15
dockerfiles/mariadb/5.5/ubuntu-14.04/run.sh
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
VOLUME_HOME="/var/lib/mysql"
|
||||
|
||||
if [[ ! -d $VOLUME_HOME/mysql ]]; then
|
||||
echo "=> An empty or uninitialized MariaDB volume is detected in $VOLUME_HOME"
|
||||
echo "=> Installing MariaDB ..."
|
||||
mysql_install_db > /dev/null 2>&1
|
||||
echo "=> Done!"
|
||||
/home/init_user.sh
|
||||
else
|
||||
echo "=> Using an existing volume of MariaDB"
|
||||
fi
|
||||
|
||||
exec mysqld_safe
|
37
dockerfiles/mariadb/README.md
Normal file
37
dockerfiles/mariadb/README.md
Normal file
@ -0,0 +1,37 @@
|
||||
# Build
|
||||
```
|
||||
$ docker build --force-rm --no-cache -t envdev/mariadb:<version>-<distrib> mariadb/<version>/<distrib>/
|
||||
```
|
||||
|
||||
# Usage
|
||||
* 5.5-ubuntu
|
||||
* 10.0-ubuntu
|
||||
* 10.1-ubuntu
|
||||
* 10.2-debian
|
||||
* In `docker run` specify `--user mysql`
|
||||
|
||||
The first time that you run your container, a new user `admin` with all privileges
|
||||
will be created in MariaDB with a random password. To get the password, check the logs
|
||||
of the container by running:
|
||||
|
||||
docker logs <CONTAINER_ID>
|
||||
|
||||
You will see an output like the following:
|
||||
|
||||
========================================================================
|
||||
You can now connect to this MariaDB Server using:
|
||||
|
||||
mysql -uadmin -pxVN33tWOhM3u -h<host> -P<port>
|
||||
|
||||
Please remember to change the above password as soon as possible!
|
||||
MariaDB user 'root' has no password but only allows local connections
|
||||
========================================================================
|
||||
|
||||
In this case, `xVN33tWOhM3u` is the password assigned to the `admin` user.
|
||||
|
||||
## Setting a specific password for the admin account
|
||||
|
||||
If you want to use a preset password instead of a random generated one, you can
|
||||
set the environment variable `MARIADB_PASS` to your specific password when running the container:
|
||||
|
||||
`$ docker run -d -p 3306:3306 -e MARIADB_PASS="mypass" envdev/mariadb`
|
24
dockerfiles/php-cli/5.5/ubuntu14.04/Dockerfile
Normal file
24
dockerfiles/php-cli/5.5/ubuntu14.04/Dockerfile
Normal file
@ -0,0 +1,24 @@
|
||||
FROM ubuntu:14.04
|
||||
|
||||
ENV TERM xterm
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
# Installation
|
||||
RUN apt-get update && apt-get -y install software-properties-common nano && \
|
||||
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db && \
|
||||
add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://ftp.igh.cnrs.fr/pub/mariadb/repo/10.1/ubuntu trusty main' && \
|
||||
apt-get update && apt-get -y upgrade && apt-get -y install mariadb-client-10.1 pwgen \
|
||||
php5-cli php5-mcrypt php5-apcu php5-curl php5-xmlrpc php5-xsl php5-mysqlnd php5-gd \
|
||||
php5-json php5-intl php5-imagick && \
|
||||
sed -i -e 's/short_open_tag = Off/short_open_tag = On/g' /etc/php5/cli/php.ini && \
|
||||
sed -i -e 's/;mbstring.internal_encoding = UTF-8/mbstring.internal_encoding = UTF-8/g' /etc/php5/cli/php.ini && \
|
||||
sed -i -e 's/;date.timezone =/date.timezone = Europe\/Paris/g' /etc/php5/cli/php.ini && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
||||
echo "Europe/Paris" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
|
||||
|
||||
# Add cron file description
|
||||
|
||||
# Add VOLUMEs
|
||||
VOLUME ["/home/vhosts"]
|
||||
|
||||
CMD ["cron", "-f"]
|
24
dockerfiles/php-cli/7.0/ubuntu16.04/Dockerfile
Normal file
24
dockerfiles/php-cli/7.0/ubuntu16.04/Dockerfile
Normal file
@ -0,0 +1,24 @@
|
||||
FROM ubuntu:16.04
|
||||
|
||||
ENV TERM xterm
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV TZ=Europe/Paris
|
||||
|
||||
# Installation
|
||||
RUN apt-get update && apt-get -y install software-properties-common nano && \
|
||||
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 && \
|
||||
add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://ftp.igh.cnrs.fr/pub/mariadb/repo/10.1/ubuntu xenial main' && \
|
||||
apt-get update && apt-get -y upgrade && apt-get -y install mariadb-client-10.1 pwgen \
|
||||
php7.0-cli php7.0-mcrypt php7.0-curl php7.0-xmlrpc php7.0-xsl php7.0-mysqlnd php7.0-gd \
|
||||
php7.0-json php7.0-intl php-imagick php-apcu && \
|
||||
sed -i -e 's/short_open_tag = Off/short_open_tag = On/g' /etc/php/7.0/cli/php.ini && \
|
||||
sed -i -e 's/;mbstring.internal_encoding = UTF-8/mbstring.internal_encoding = UTF-8/g' /etc/php/7.0/cli/php.ini && \
|
||||
sed -i -e 's/;date.timezone =/date.timezone = Europe\/Paris/g' /etc/php/7.0/cli/php.ini && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Add cron file description
|
||||
|
||||
# Add VOLUMEs
|
||||
VOLUME ["/home/vhosts"]
|
||||
|
||||
CMD ["cron", "-f"]
|
6
dockerfiles/php-cli/README.md
Normal file
6
dockerfiles/php-cli/README.md
Normal file
@ -0,0 +1,6 @@
|
||||
# Build
|
||||
```
|
||||
$ docker build --force-rm --no-cache -t envdev/php-cli:<version>-<distrib> php-cli/<version>/<arch>/
|
||||
```
|
||||
|
||||
# Usage
|
34
dockerfiles/php-fpm/5.5/ubuntu-14.04/Dockerfile
Normal file
34
dockerfiles/php-fpm/5.5/ubuntu-14.04/Dockerfile
Normal file
@ -0,0 +1,34 @@
|
||||
FROM ubuntu:14.04
|
||||
|
||||
ENV TERM xterm
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
# Installation
|
||||
RUN apt-get update && apt-get -y install software-properties-common nano && \
|
||||
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db && \
|
||||
add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://ftp.igh.cnrs.fr/pub/mariadb/repo/10.1/ubuntu trusty main' && \
|
||||
apt-get update && apt-get -y upgrade && apt-get -y install mariadb-client-10.1 pwgen \
|
||||
php5-fpm php5-mcrypt php5-curl php5-xmlrpc php5-xsl php5-mysqlnd php5-gd \
|
||||
php5-json php5-intl php5-imagick php5-apcu php-mbstring php5-redis && \
|
||||
sed -i -e 's/max_execution_time = 30/max_execution_time = 300/g' /etc/php5/fpm/php.ini && \
|
||||
sed -i -e 's/short_open_tag = Off/short_open_tag = On/g' /etc/php5/fpm/php.ini && \
|
||||
sed -i -e 's/;realpath_cache_size = 16k/realpath_cache_size = 1M/g' /etc/php5/fpm/php.ini && \
|
||||
sed -i -e 's/;mbstring.internal_encoding = UTF-8/mbstring.internal_encoding = UTF-8/g' /etc/php5/fpm/php.ini && \
|
||||
sed -i -e 's/;date.timezone =/date.timezone = Europe\/Paris/g' /etc/php5/fpm/php.ini && \
|
||||
sed -i -e 's/post_max_size = 8M/post_max_size = 50M/g' /etc/php5/fpm/php.ini && \
|
||||
sed -i -e 's/upload_max_filesize = 2M/upload_max_filesize = 50M/g' /etc/php5/fpm/php.ini && \
|
||||
sed -i -e 's/session.save_handler = files/session.save_handler = redis/g' /etc/php5/fpm/php.ini && \
|
||||
sed -i -e 's/;session.save_path = "\/var\/lib\/php5"/session.save_path = "$REDIS_PORT_6379_TCP"/g' /etc/php5/fpm/php.ini && \
|
||||
sed -i -e 's/session.gc_maxlifetime = 1440/session.gc_maxlifetime = 86400/g' /etc/php5/fpm/php.ini && \
|
||||
sed -i -e 's/;opcache.enable=0/opcache.enable=1/g' /etc/php5/fpm/php.ini && \
|
||||
sed -i -e 's/listen =[.]*$/listen = 9000/g' /etc/php5/fpm/pool.d/www.conf && \
|
||||
touch /var/log/php5-fpm.log && chown www-data /var/log/php5-fpm.log && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
||||
echo "Europe/Paris" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
|
||||
|
||||
# Add VOLUMEs
|
||||
VOLUME ["/home/vhosts"]
|
||||
|
||||
EXPOSE 9000
|
||||
|
||||
CMD ["php5-fpm", "-F"]
|
34
dockerfiles/php-fpm/5.6/debian-8/Dockerfile
Normal file
34
dockerfiles/php-fpm/5.6/debian-8/Dockerfile
Normal file
@ -0,0 +1,34 @@
|
||||
FROM debian:8
|
||||
|
||||
# Environment
|
||||
ENV TERM xterm
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV TZ=Europe/Paris
|
||||
|
||||
# Installation
|
||||
RUN apt-get update && apt-get -y install software-properties-common procps nano wget && \
|
||||
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db && \
|
||||
add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://ftp.igh.cnrs.fr/pub/mariadb/repo/10.2/debian jessie main' && \
|
||||
apt-get update && apt-get -y upgrade && apt-get -y install mariadb-client-10.2 pwgen \
|
||||
php5-fpm php5-mcrypt php5-mbstring php5-curl php5-xmlrpc php5-xsl php5-mysqlnd php5-gd \
|
||||
php5-json php5-intl php5-imagick php5-apcu && \
|
||||
sed -i -e 's/max_execution_time = 30/max_execution_time = 300/g' /etc/php5/fpm/php.ini && \
|
||||
sed -i -e 's/short_open_tag = Off/short_open_tag = On/g' /etc/php5/fpm/php.ini && \
|
||||
sed -i -e 's/;realpath_cache_size = 16k/realpath_cache_size = 1M/g' /etc/php5/fpm/php.ini && \
|
||||
sed -i -e 's/;mbstring.internal_encoding = UTF-8/mbstring.internal_encoding = UTF-8/g' /etc/php5/fpm/php.ini && \
|
||||
sed -i -e 's/;date.timezone =/date.timezone = Europe\/Paris/g' /etc/php5/fpm/php.ini && \
|
||||
sed -i -e 's/post_max_size = 8M/post_max_size = 50M/g' /etc/php5/fpm/php.ini && \
|
||||
sed -i -e 's/upload_max_filesize = 2M/upload_max_filesize = 50M/g' /etc/php5/fpm/php.ini && \
|
||||
sed -i -e 's/session.gc_maxlifetime = 1440/session.gc_maxlifetime = 86400/g' /etc/php5/fpm/php.ini && \
|
||||
sed -i -e 's/;opcache.enable=0/opcache.enable=1/g' /etc/php5/fpm/php.ini && \
|
||||
sed -i -e 's/^listen =.*/listen = 9000/g' /etc/php5/fpm/pool.d/www.conf && \
|
||||
touch /var/log/php5-fpm.log && chown www-data /var/log/php5-fpm.log && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
||||
echo "Europe/Paris" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
|
||||
|
||||
# Add VOLUMEs
|
||||
VOLUME ["/home/vhosts"]
|
||||
|
||||
# Expose and Run
|
||||
EXPOSE 9000
|
||||
CMD ["php5-fpm", "-F"]
|
44
dockerfiles/php-fpm/7.0/debian-9/Dockerfile
Normal file
44
dockerfiles/php-fpm/7.0/debian-9/Dockerfile
Normal file
@ -0,0 +1,44 @@
|
||||
FROM debian:9
|
||||
|
||||
# Environment
|
||||
ENV TERM xterm
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV TZ=Europe/Paris
|
||||
|
||||
# Installation
|
||||
RUN apt-get update && apt-get -y install software-properties-common procps gnupg nano wget git && \
|
||||
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 && \
|
||||
add-apt-repository 'deb [arch=amd64] http://ftp.igh.cnrs.fr/pub/mariadb/repo/10.2/debian stretch main' && \
|
||||
apt-get update && apt-get -y upgrade && apt-get -y install mariadb-client-10.2 pwgen \
|
||||
php7.0-fpm php7.0-mcrypt php7.0-mbstring php7.0-curl php7.0-xmlrpc php7.0-xsl php7.0-mysql php7.0-json php7.0-intl \
|
||||
php7.0-zip php7.0-gd php-apcu && \
|
||||
sed -i -e 's/max_execution_time = 30/max_execution_time = 300/g' /etc/php/7.0/fpm/php.ini && \
|
||||
sed -i -e 's/short_open_tag = Off/short_open_tag = On/g' /etc/php/7.0/fpm/php.ini && \
|
||||
sed -i -e 's/;realpath_cache_size = 16k/realpath_cache_size = 1M/g' /etc/php/7.0/fpm/php.ini && \
|
||||
sed -i -e 's/;mbstring.internal_encoding = UTF-8/mbstring.internal_encoding = UTF-8/g' /etc/php/7.0/fpm/php.ini && \
|
||||
sed -i -e 's/;date.timezone =/date.timezone = Europe\/Paris/g' /etc/php/7.0/fpm/php.ini && \
|
||||
sed -i -e 's/post_max_size = 8M/post_max_size = 50M/g' /etc/php/7.0/fpm/php.ini && \
|
||||
sed -i -e 's/upload_max_filesize = 2M/upload_max_filesize = 50M/g' /etc/php/7.0/fpm/php.ini && \
|
||||
sed -i -e 's/session.gc_maxlifetime = 1440/session.gc_maxlifetime = 86400/g' /etc/php/7.0/fpm/php.ini && \
|
||||
sed -i -e 's/;opcache.enable=0/opcache.enable=1/g' /etc/php/7.0/fpm/php.ini && \
|
||||
sed -i -e 's/^listen =.*/listen = 9000/g' /etc/php/7.0/fpm/pool.d/www.conf && \
|
||||
sed -i -e 's/^user = www-data/user = fpm/g' /etc/php/7.0/fpm/pool.d/www.conf && \
|
||||
sed -i -e 's/^group = www-data/group = fpm/g' /etc/php/7.0/fpm/pool.d/www.conf && \
|
||||
touch /var/log/php7.0-fpm.log && mkdir /run/php && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
||||
echo "Europe/Paris" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
|
||||
|
||||
COPY composer-install.sh /
|
||||
COPY entrypoint.sh /
|
||||
|
||||
RUN chmod +x /composer-install.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
# Add VOLUMEs
|
||||
VOLUME ["/home/vhosts"]
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
# Expose and Run
|
||||
EXPOSE 9000
|
||||
CMD ["php-fpm7.0", "-F"]
|
17
dockerfiles/php-fpm/7.0/debian-9/composer-install.sh
Normal file
17
dockerfiles/php-fpm/7.0/debian-9/composer-install.sh
Normal file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig)
|
||||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")
|
||||
|
||||
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
|
||||
then
|
||||
>&2 echo 'ERROR: Invalid installer signature'
|
||||
rm composer-setup.php
|
||||
exit 1
|
||||
fi
|
||||
|
||||
php composer-setup.php --filename=composer --install-dir=/usr/local/bin --quiet
|
||||
RESULT=$?
|
||||
rm composer-setup.php
|
||||
exit $RESULT
|
12
dockerfiles/php-fpm/7.0/debian-9/entrypoint.sh
Normal file
12
dockerfiles/php-fpm/7.0/debian-9/entrypoint.sh
Normal file
@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Add local user
|
||||
# Either use the LOCAL_USER_ID if passed in at runtime or
|
||||
# fallback
|
||||
|
||||
USER_ID=${LOCAL_USER_ID:-9001}
|
||||
|
||||
echo "FPM USER ID : $USER_ID"
|
||||
useradd --shell /bin/bash -u $USER_ID -o -c "" -m fpm
|
||||
|
||||
exec "$@"
|
33
dockerfiles/php-fpm/7.0/ubuntu-16.04/Dockerfile
Normal file
33
dockerfiles/php-fpm/7.0/ubuntu-16.04/Dockerfile
Normal file
@ -0,0 +1,33 @@
|
||||
FROM ubuntu:16.04
|
||||
|
||||
ENV TERM xterm
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV TZ=Europe/Paris
|
||||
|
||||
# Installation
|
||||
RUN apt-get update && apt-get -y install software-properties-common nano && \
|
||||
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 && \
|
||||
add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://ftp.igh.cnrs.fr/pub/mariadb/repo/10.1/ubuntu xenial main' && \
|
||||
apt-get update && apt-get -y upgrade && apt-get -y install mariadb-client-10.1 pwgen \
|
||||
php7.0-fpm php7.0-mcrypt php7.0-curl php7.0-xmlrpc php7.0-xsl php7.0-mysqlnd php7.0-gd \
|
||||
php7.0-json php7.0-intl php-imagick php-apcu php-mbstring php-redis && \
|
||||
sed -i -e 's/max_execution_time = 30/max_execution_time = 300/g' /etc/php/7.0/fpm/php.ini && \
|
||||
sed -i -e 's/short_open_tag = Off/short_open_tag = On/g' /etc/php/7.0/fpm/php.ini && \
|
||||
sed -i -e 's/;realpath_cache_size = 16k/realpath_cache_size = 1M/g' /etc/php/7.0/fpm/php.ini && \
|
||||
sed -i -e 's/;mbstring.internal_encoding = UTF-8/mbstring.internal_encoding = UTF-8/g' /etc/php/7.0/fpm/php.ini && \
|
||||
sed -i -e 's/;date.timezone =/date.timezone = Europe\/Paris/g' /etc/php/7.0/fpm/php.ini && \
|
||||
sed -i -e 's/post_max_size = 8M/post_max_size = 50M/g' /etc/php/7.0/fpm/php.ini && \
|
||||
sed -i -e 's/upload_max_filesize = 2M/upload_max_filesize = 50M/g' /etc/php/7.0/fpm/php.ini && \
|
||||
sed -i -e 's/session.save_handler = files/session.save_handler = redis/g' /etc/php/7.0/fpm/php.ini && \
|
||||
sed -i -e 's/;session.save_path = "\/var\/lib\/php\/sessions"/session.save_path = "$REDIS_PORT_6379_TCP"/g' /etc/php/7.0/fpm/php.ini && \
|
||||
sed -i -e 's/session.gc_maxlifetime = 1440/session.gc_maxlifetime = 86400/g' /etc/php/7.0/fpm/php.ini && \
|
||||
sed -i -e 's/;opcache.enable=0/opcache.enable=1/g' /etc/php/7.0/fpm/php.ini && \
|
||||
sed -i -e 's/listen = \/run\/php\/php7.0-fpm.sock$/listen = 9000/g' /etc/php/7.0/fpm/pool.d/www.conf && \
|
||||
mkdir /run/php && apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Add VOLUMEs
|
||||
VOLUME ["/home/vhosts"]
|
||||
|
||||
# Expose and Run
|
||||
EXPOSE 9000
|
||||
CMD ["php-fpm7.0", "-F"]
|
6
dockerfiles/php-fpm/README.md
Normal file
6
dockerfiles/php-fpm/README.md
Normal file
@ -0,0 +1,6 @@
|
||||
# Build
|
||||
```
|
||||
$ docker build --force-rm --no-cache -t envdev/php-fpm:<version>-<distrib> php-fpm/<version>/<distrib>/
|
||||
```
|
||||
|
||||
# Usage
|
4
dockerfiles/redis/3.2/Dockerfile
Normal file
4
dockerfiles/redis/3.2/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
||||
FROM redis:3.2
|
||||
|
||||
COPY redis.conf /usr/local/etc/redis/redis.conf
|
||||
CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
|
1052
dockerfiles/redis/3.2/redis.conf
Normal file
1052
dockerfiles/redis/3.2/redis.conf
Normal file
File diff suppressed because it is too large
Load Diff
4
dockerfiles/redis/4.0/Dockerfile
Normal file
4
dockerfiles/redis/4.0/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
||||
FROM redis:4.0
|
||||
|
||||
COPY redis.conf /usr/local/etc/redis/redis.conf
|
||||
CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
|
1052
dockerfiles/redis/4.0/redis.conf
Normal file
1052
dockerfiles/redis/4.0/redis.conf
Normal file
File diff suppressed because it is too large
Load Diff
6
dockerfiles/redis/README.md
Normal file
6
dockerfiles/redis/README.md
Normal file
@ -0,0 +1,6 @@
|
||||
# Build
|
||||
```
|
||||
$ docker build --force-rm --no-cache -t envdev/redis:<version> redis/<version>/
|
||||
```
|
||||
|
||||
# Usage
|
Loading…
Reference in New Issue
Block a user