mirror of
https://github.com/devilbox/docker-php-fpm.git
synced 2025-12-22 17:01:14 +00:00
Adjust prod Docker
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Auto-generated via Ansible
|
||||
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead.
|
||||
FROM php:{{ php_version }}-fpm
|
||||
MAINTAINER "cytopia" <cytopia@everythingcli.org>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Auto-generated via Ansible
|
||||
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-mods.j2 instead.
|
||||
FROM devilbox/php-fpm:{{ php_version }}-base
|
||||
MAINTAINER "cytopia" <cytopia@everythingcli.org>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Auto-generated via Ansible
|
||||
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead.
|
||||
FROM devilbox/php-fpm:{{ php_version }}-mods
|
||||
MAINTAINER "cytopia" <cytopia@everythingcli.org>
|
||||
|
||||
@@ -35,19 +35,6 @@ RUN set -x \
|
||||
|
||||
|
||||
|
||||
###
|
||||
### Configure
|
||||
###
|
||||
RUN set -x \
|
||||
&& { \
|
||||
echo "[mail function]"; \
|
||||
echo "sendmail_path = /usr/sbin/sendmail -t -i"; \
|
||||
echo ";mail.force_extra_parameters ="; \
|
||||
echo "mail.add_x_header = On"; \
|
||||
echo "mail.log = /var/log/php/mail.log"; \
|
||||
} > /usr/local/etc/php/conf.d/devilbox-mail.ini
|
||||
|
||||
|
||||
{% if debug %}
|
||||
###
|
||||
### Verify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Auto-generated via Ansible
|
||||
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-work.j2 instead.
|
||||
FROM devilbox/php-fpm:{{ php_version }}-prod
|
||||
MAINTAINER "cytopia" <cytopia@everythingcli.org>
|
||||
|
||||
@@ -15,7 +15,7 @@ LABEL \
|
||||
|
||||
|
||||
###
|
||||
### Envs (Already set in parent container)
|
||||
### Envs
|
||||
###
|
||||
ENV BASH_PROFILE=".bashrc"
|
||||
|
||||
@@ -23,9 +23,37 @@ ENV BASH_PROFILE=".bashrc"
|
||||
###
|
||||
### Install Tools
|
||||
###
|
||||
|
||||
# System dev tools
|
||||
RUN set -x \
|
||||
&& apt-get update \
|
||||
&& apt-get install --no-install-recommends --no-install-suggests -y \
|
||||
dirmngr \
|
||||
gnupg \
|
||||
{% for repo in apt_repositories_enabled %}
|
||||
{# Not disabled #}
|
||||
{% if ('disabled' not in apt_repositories_available[repo]) or (php_version not in apt_repositories_available[repo]['disabled']) %}
|
||||
{# Version specific pre-command available? #}
|
||||
{% if php_version in apt_repositories_available[repo] and 'pre' in apt_repositories_available[repo][php_version] %}
|
||||
&& {{ apt_repositories_available[repo][php_version]['pre'] }} \
|
||||
{# Generic pre-command available? #}
|
||||
{% elif 'all' in apt_repositories_available[repo] and 'pre' in apt_repositories_available[repo]['all'] %}
|
||||
&& {{ apt_repositories_available[repo]['all']['pre'] }} \
|
||||
{% endif %}
|
||||
{# Version specific key available? #}
|
||||
{% if php_version in apt_repositories_available[repo] and 'key' in apt_repositories_available[repo][php_version] %}
|
||||
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv {{ apt_repositories_available[repo][php_version]['key'] }} \
|
||||
{# Generic key available? #}
|
||||
{% elif 'all' in apt_repositories_available[repo] and 'key' in apt_repositories_available[repo]['all'] %}
|
||||
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv {{ apt_repositories_available[repo]['all']['key'] }} \
|
||||
{% endif %}
|
||||
{# Version specific repository available? #}
|
||||
{% if php_version in apt_repositories_available[repo] and 'deb' in apt_repositories_available[repo][php_version] %}
|
||||
&& echo "{{ apt_repositories_available[repo][php_version]['deb'] }}" > /etc/apt/sources.list.d/{{ repo }}.list \
|
||||
{# Generic repository available? #}
|
||||
{% else %}
|
||||
&& echo "{{ apt_repositories_available[repo]['all']['deb'] }}" > /etc/apt/sources.list.d/{{ repo }}.list \
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
&& apt-get update \
|
||||
&& apt-get install --no-install-recommends --no-install-suggests -y \
|
||||
ack-grep \
|
||||
@@ -49,14 +77,15 @@ RUN set -x \
|
||||
less \
|
||||
libc-dev \
|
||||
make \
|
||||
# mongo-tools \
|
||||
mongodb-clients \
|
||||
mongodb-org-shell \
|
||||
mongodb-org-tools \
|
||||
moreutils \
|
||||
mysql-client \
|
||||
nano \
|
||||
net-tools \
|
||||
netcat \
|
||||
# postgresql-client \
|
||||
nodejs \
|
||||
postgresql-client \
|
||||
python-pip \
|
||||
rubygems \
|
||||
ruby-dev \
|
||||
@@ -73,97 +102,37 @@ RUN set -x \
|
||||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
## Node / NPM
|
||||
#RUN set -x \
|
||||
# && mkdir -p /usr/local/src \
|
||||
# && VERSION="$( curl -Lq https://nodejs.org 2>/dev/null | grep LTS | grep -Eo 'data-version.*.' | grep -oE 'v[0-9.]+' )" \
|
||||
# && wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 --tries=30 \
|
||||
# -P /usr/local/src https://nodejs.org/dist/${VERSION}/node-${VERSION}-linux-x64.tar.xz \
|
||||
# && unxz /usr/local/src/node-${VERSION}-linux-x64.tar.xz \
|
||||
# && tar xvf /usr/local/src/node-${VERSION}-linux-x64.tar -C /usr/local/src \
|
||||
# && ln -s /usr/local/src/node-${VERSION}-linux-x64 /usr/local/node \
|
||||
# && ln -s /usr/local/node/bin/* /usr/local/bin/ \
|
||||
# && rm -rf /usr/local/src/node-${VERSION}-linux-x64.tar* \
|
||||
# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/LICENSE \
|
||||
# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/*.md \
|
||||
# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/include \
|
||||
# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/share \
|
||||
# && npm --version | grep -E '[.0-9]+' \
|
||||
# && node --version | grep -E '[.0-9]+' \
|
||||
# && rm -rf /root/.config
|
||||
#
|
||||
## Composer
|
||||
#RUN set -x \
|
||||
# && curl -sS https://getcomposer.org/installer | php \
|
||||
# && mv composer.phar /usr/local/bin/composer \
|
||||
# && composer self-update
|
||||
## && composer --version 2>/dev/null | grep -E 'version\s*[.0-9]+' \
|
||||
## && rm -rf /root/.composer
|
||||
#
|
||||
## Drush
|
||||
#RUN set -x \
|
||||
# && DRUSH_VERSION="$( curl -q https://api.github.com/repos/drush-ops/drush/releases 2>/dev/null | grep tag_name | grep -Eo '\"[0-9.]+\"' | head -1 | sed 's/\"//g' )" \
|
||||
# && mkdir -p /usr/local/src \
|
||||
# && git clone https://github.com/drush-ops/drush.git /usr/local/src/drush \
|
||||
# && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/drush \
|
||||
# && v="${DRUSH_VERSION}" su ${MY_USER} -p -c 'cd /usr/local/src/drush && git checkout ${v}' \
|
||||
# && su - ${MY_USER} -c 'PATH=/usr/local/bin:$PATH; cd /usr/local/src/drush && composer install --no-interaction --no-progress' \
|
||||
# && ln -s /usr/local/src/drush/drush /usr/local/bin/drush \
|
||||
# && drush --version | grep -E '[.0-9]+' \
|
||||
# && rm -rf /usr/local/src/drush/.git \
|
||||
# && rm -rf /usr/local/src/drush/docs \
|
||||
# && rm -rf /usr/local/src/drush/examples \
|
||||
# && rm -rf /usr/local/src/drush/misc \
|
||||
# && rm -rf /usr/local/src/drush/tests \
|
||||
# && rm -rf /root/.drush \
|
||||
# && rm -rf /home/${MY_USER}/.composer
|
||||
#
|
||||
## Drupal Console
|
||||
#RUN set -x \
|
||||
# && curl https://drupalconsole.com/installer -L -o drupal.phar \
|
||||
# && mv drupal.phar /usr/local/bin/drupal \
|
||||
# && chmod +x /usr/local/bin/drupal
|
||||
## && drupal --version | grep -E 'version\s*[.0-9]'
|
||||
#
|
||||
## WP-CLI
|
||||
#RUN set -x \
|
||||
# && curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
|
||||
# && mv wp-cli.phar /usr/local/bin/wp \
|
||||
# && chmod +x /usr/local/bin/wp \
|
||||
# && wp cli update \
|
||||
# && wp --allow-root --version | grep -E '[.0-9]+'
|
||||
#
|
||||
## Symfony CLI
|
||||
#RUN set -x \
|
||||
# && curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony \
|
||||
# && chmod +x /usr/local/bin/symfony \
|
||||
# && symfony --version | grep -E 'version\s*[.0-9]+'
|
||||
#
|
||||
## Laravel CLI
|
||||
#RUN set -x \
|
||||
# && mkdir -p /usr/local/src \
|
||||
# && git clone https://github.com/laravel/installer /usr/local/src/laravel-installer \
|
||||
# && cd /usr/local/src/laravel-installer \
|
||||
# && git checkout $(git describe --abbrev=0 --tags) \
|
||||
# && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/laravel-installer \
|
||||
# && su - ${MY_USER} -c 'PATH=/usr/local/bin:$PATH; cd /usr/local/src/laravel-installer && composer install' \
|
||||
# && ln -s /usr/local/src/laravel-installer/laravel /usr/local/bin/laravel \
|
||||
# && rm -rf /usr/local/src/laravel-installer/laravel/.git
|
||||
## && laravel --version | grep -E 'version\s*[.0-9]+' \
|
||||
## && rm -rf /home/${MY_USER}/.composer
|
||||
#
|
||||
## Phalcon DevTools
|
||||
##RUN set -x \
|
||||
## && mkdir -p /usr/local/src \
|
||||
## && git clone https://github.com/phalcon/phalcon-devtools /usr/local/src/phalcon-devtools \
|
||||
## && cd /usr/local/src/phalcon-devtools \
|
||||
## && git checkout $(git tag | grep 'v3.0' | sort -V | tail -1) \
|
||||
## && su - ${MY_USER} -c 'cd /usr/local/src/phalcon-devtools && ./phalcon.sh' \
|
||||
## && ln -s /usr/local/src/phalcon-devtools/phalcon.php /usr/local/bin/phalcon \
|
||||
## && cd / \
|
||||
## && rm -rf /usr/local/src/phalcon-devtools/.git \
|
||||
## && phalcon commands | grep -E '[.0-9]+'
|
||||
#
|
||||
|
||||
{% for tool in software_enabled %}
|
||||
{# Not disabled #}
|
||||
{% if ('disabled' not in software_available[tool]) or (php_version not in software_available[tool]['disabled']) %}
|
||||
# {{ tool }}
|
||||
RUN set -x true \
|
||||
{# Version specific pre-command available? #}
|
||||
{% if php_version in software_available[tool] and 'pre' in software_available[tool][php_version] %}
|
||||
&& {{ software_available[tool][php_version]['pre'] }} \
|
||||
{# Generic pre-command available? #}
|
||||
{% elif 'all' in software_available[tool] and 'pre' in software_available[tool]['all'] %}
|
||||
&& {{ software_available[tool]['all']['pre'] }} \
|
||||
{% endif %}
|
||||
{# Version specific command available? #}
|
||||
{% if php_version in software_available[tool] and 'command' in software_available[tool][php_version] %}
|
||||
&& {{ software_available[tool][php_version]['command'] }} \
|
||||
{# Generic command available? #}
|
||||
{% else %}
|
||||
&& {{ software_available[tool]['all']['command'] }} \
|
||||
{% endif %}
|
||||
{# Version specific post-command available? #}
|
||||
{% if php_version in software_available[tool] and 'post' in software_available[tool][php_version] %}
|
||||
&& {{ software_available[tool][php_version]['post'] }} \
|
||||
{# Generic post-command available? #}
|
||||
{% elif 'all' in software_available[tool] and 'post' in software_available[tool]['all'] %}
|
||||
&& {{ software_available[tool]['all']['post'] }} \
|
||||
{% endif %}
|
||||
&& true
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
## Mysqldump-secure
|
||||
#RUN set -x \
|
||||
# && mkdir -p /usr/local/src \
|
||||
@@ -279,6 +248,15 @@ RUN set -x \
|
||||
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
|
||||
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi
|
||||
|
||||
RUN set -x \
|
||||
{% for tool in software_enabled %}
|
||||
{# Not disabled #}
|
||||
{% if ('disabled' not in software_available[tool]) or (php_version not in software_available[tool]['disabled']) %}
|
||||
&& {{ software_available[tool]['check'] }} \
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
&& true
|
||||
|
||||
|
||||
{% endif %}
|
||||
###
|
||||
|
||||
Reference in New Issue
Block a user