Commit 32111fb9 authored by thomas craipeau's avatar thomas craipeau
Browse files

start update php 7

parent 8d4526eb
......@@ -12,6 +12,7 @@ services:
- "5017:27017"
front:
build: docker-front
container_name: frontphp7
ports:
- "5080:80"
- "5443:443"
......
FROM php:5.6.31-fpm
FROM php:7.2-fpm
ENV MONGO_URL ${MONGO_URL}
ONBUILD ENV MONGO_URL ${MONGO_URL}
......@@ -6,43 +6,51 @@ ENV MONGO_DB ${MONGO_DB}
ONBUILD ENV MONGO_URL ${MONGO_DB}
# Install packages
RUN sed -i '/jessie-updates/d' /etc/apt/sources.list
#RUN sed -i '/jessie-updates/d' /etc/apt/sources.list
RUN apt-get update && apt-get install -my \
nginx \
curl \
supervisor \
git \
zip \
wget \
php5-curl \
php5-fpm \
php5-gd \
php5-memcached \
php5-mysql \
php5-mcrypt \
php5-sqlite \
php5-xdebug \
php5-mongo \
php-apc
nano \
libmcrypt-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libcurl4-gnutls-dev \
curl
RUN pecl install redis-4.0.1 \
&& pecl install xdebug-2.6.0 \
&& pecl install mongodb-1.6.0 \
&& pecl install mcrypt-1.0.2
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-enable redis xdebug mongodb mcrypt \
&& docker-php-ext-install curl
# Remove default nginx configs.
RUN rm -f /etc/nginx/conf.d/*
# * Ensure that PHP5 FPM is run as root.
# * Ensure that php FPM is run as root.
# * Pass all docker environment
# * Get access to FPM-ping page /ping
# * Get access to FPM_Status page /status
# * Prevent PHP Warning: 'xdebug' already loaded.
# * XDebug loaded with the core
RUN sed -i "s/user = www-data/user = root/" /etc/php5/fpm/pool.d/www.conf && \
sed -i "s/group = www-data/group = root/" /etc/php5/fpm/pool.d/www.conf && \
sed -i '/^;clear_env = no/s/^;//' /etc/php5/fpm/pool.d/www.conf && \
sed -i '/^;ping\.path/s/^;//' /etc/php5/fpm/pool.d/www.conf && \
sed -i '/^;pm\.status_path/s/^;//' /etc/php5/fpm/pool.d/www.conf && \
sed -i '/.*xdebug.so$/s/^/;/' /etc/php5/mods-available/xdebug.ini
RUN sed -i "s/user = www-data/user = root/" /usr/local/etc/php-fpm.d/www.conf && \
sed -i "s/group = www-data/group = root/" /usr/local/etc/php-fpm.d/www.conf && \
sed -i '/^;clear_env = no/s/^;//' /usr/local/etc/php-fpm.d/www.conf && \
sed -i '/^;ping\.path/s/^;//' /usr/local/etc/php-fpm.d/www.conf && \
sed -i '/^;pm\.status_path/s/^;//' /usr/local/etc/php-fpm.d/www.conf
#sed -i '/.*xdebug.so$/s/^/;/' /usr/local/etc/php/mods-available/xdebug.ini
# Add configuration files
COPY front-conf/nginx.conf /etc/nginx/
COPY front-conf/supervisord.conf /etc/supervisor/conf.d/
COPY front-conf/php.ini /etc/php5/fpm/conf.d/40-custom.ini
COPY front-conf/php.ini /usr/local/etc/php/fpm/conf.d/40-custom.ini
COPY front-conf/communecter.conf /etc/nginx/conf.d/
EXPOSE 80 443 9001
......
......@@ -36,7 +36,7 @@ server {
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_pass 127.0.0.1:9000;
}
}
......@@ -46,7 +46,7 @@ server {
deny all;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /status;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_pass 127.0.0.1:9000;
}
location /ping {
......@@ -54,7 +54,7 @@ server {
allow all;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /ping;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_pass 127.0.0.1:9000;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
......@@ -68,6 +68,6 @@ server {
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_pass 127.0.0.1:9000;
}
}
......@@ -9,7 +9,7 @@ command = /usr/sbin/nginx
user = root
autostart = true
[program:php5-fpm]
command = /usr/sbin/php5-fpm -FR
[program:php-fpm]
command = /usr/local/sbin/php-fpm -FR
user = root
autostart = true
FROM debian:jessie
FROM php:7.2-cli-stretch
# Install repos lists
RUN echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.4 main" | \
tee /etc/apt/sources.list.d/mongodb-org-3.4.list
#RUN echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/3.4 main" | \
# tee /etc/apt/sources.list.d/mongodb-org-3.4.list
# Add key and install packages
# TODO Key problem for mongodb
RUN sed -i '/jessie-updates/d' /etc/apt/sources.list
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6 && \
apt-get update && \
apt-get install --force-yes -y \
mongodb-org-shell \
mongodb-org-tools && \
# RUN sed -i '/jessie-updates/d' /etc/apt/sources.list
RUN apt-get update && apt-get install -y gnupg2
RUN apt-get update && \
apt-get install -y \
mongodb && \
apt-get install -my \
git \
curl \
php5-curl \
php5-cli \
zip \
supervisor \
libcurl4-gnutls-dev \
libmcrypt-dev \
libreadline-dev \
wget && \
rm /etc/supervisor/supervisord.conf
RUN pecl install mongodb-1.6.0 \
&& pecl install mcrypt-1.0.2
RUN docker-php-ext-enable mongodb mcrypt \
&& docker-php-ext-install curl
COPY install-conf/supervisord.conf /etc/supervisor/supervisord.conf
COPY install.sh /usr/bin/install
COPY easyoptions.sh /usr/bin/easyoptions
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment