Commit e94c7fff authored by Mickaël Bourgier's avatar Mickaël Bourgier Committed by Mickaël Bourgier
Browse files

First commit

parents
version: "3.7"
services:
mysql56:
image: mysql:5.6
environment:
MYSQL_ROOT_PASSWORD: root
volumes:
- mysql56:/var/lib/mysql
php72:
build: ./php72
links:
- mysql56
volumes:
- type: bind
source: ./php72/php.ini
target: /usr/local/etc/php/conf.d/99-custom.ini
read_only: true
- type: bind
source: /home/chapa/Documents/Development
target: /home/chapa/Documents/Development
user: chapa
init: true
shm_size: 2gb
nginx:
image: nginx:1.15-alpine
ports:
- 80:80
links:
- php72
volumes:
- type: bind
source: ./nginx/nginx.conf
target: /etc/nginx/nginx.conf
read_only: true
- type: bind
source: ./nginx/php.conf
target: /etc/nginx/php.conf
read_only: true
- type: bind
source: ./nginx/sites
target: /etc/nginx/sites
read_only: true
- type: bind
source: /home/chapa/Documents/Development
target: /home/chapa/Documents/Development
phpmyadmin56:
image: phpmyadmin/phpmyadmin:4.8.4
environment:
PMA_USER: root
PMA_PASSWORD: root
links:
- mysql56:db
volumes:
mysql56:
name: mysql56
user nginx;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
types_hash_max_size 4096;
server_names_hash_bucket_size 128;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/errors.log;
sendfile on;
keepalive_timeout 65;
gzip on;
include /etc/nginx/sites/*;
}
location ~ \.php$ {
try_files $uri $document_root$fastcgi_script_name =404;
fastcgi_pass php72:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 1h;
include fastcgi.conf;
fastcgi_param HTTP_PROXY "";
}
server {
listen 80;
charset utf-8;
server_name aajaa.localhost api.aajaa.localhost;
root "/home/chapa/Documents/Development/Client projects/aajaa/web";
location / {
try_files $uri /app_dev.php$is_args$args;
}
location ~ \.(css|js)\.map$ {
try_files $uri =404;
}
include php.conf;
error_log /var/log/nginx/aajaa_error.log;
access_log /var/log/nginx/aajaa_access.log;
}
server {
listen 80;
charset utf-8;
server_name viewer.aajaa.localhost;
root "/home/chapa/Documents/Development/Client projects/aajaa_viewer";
index index.html;
location / {
try_files $uri $uri/ =404;
}
error_log /var/log/nginx/aajaa_viewer_error.log;
access_log /var/log/nginx/aajaa_viewer_access.log;
}
server {
listen 80;
charset utf-8;
server_name smart.affimobile.localhost api.affimobile.localhost;
root "/home/chapa/Documents/Development/Client projects/affi-mobile/web";
client_max_body_size 1000M;
location / {
try_files $uri /app_dev.php$is_args$args;
}
location ~ \.(css|js)\.map$ {
try_files $uri =404;
}
include php.conf;
error_log /var/log/nginx/affi-mobile_errors.log;
access_log /var/log/nginx/affi-mobile_access.log;
}
server {
listen 80;
charset utf-8;
server_name webdav.affimobile.localhost;
root "/home/chapa/Documents/Development/Client projects/affi-mobile/web";
client_max_body_size 1000M;
location / {
try_files $uri /webdav_dev.php$is_args$args;
}
include php.conf;
error_log /var/log/nginx/affi-mobile_webdav_errors.log;
access_log /var/log/nginx/affi-mobile_webdav_access.log;
}
map $host $app_agence {
agda.localhost agda;
immo-chartreuse.localhost immo-chartreuse;
agda-voiron.localhost agda-voiron;
resid-immo.localhost resid-immo;
alpe-agence.localhost alpe-agence;
fonciere-etoile.localhost fonciere-etoile;
agda-andreolety.localhost agda-andreolety;
agence-agda.localhost agence-agda;
arch-immo.localhost arch-immo;
bugey-immobilier.localhost bugey-immobilier;
ff-immobilier.localhost ff-immobilier;
leconnetable.localhost le-connetable;
partenariat-immo.localhost partenariat-immo;
vanoise-immo.localhost vanoise-immo;
damiers-annecy.localhost damiers-annecy;
delastre-immobilier.localhost delastre-immobilier;
delastre-villeurbanne.localhost delastre-villeurbanne;
}
server {
listen 80;
charset utf-8;
server_name agda.localhost www.agda.localhost smart.agda.localhost api.smart.agda.localhost;
server_name immo-chartreuse.localhost agda-voiron.localhost resid-immo.localhost alpe-agence.localhost;
server_name fonciere-etoile.localhost;
server_name agda-andreolety.localhost agence-agda.localhost arch-immo.localhost bugey-immobilier.localhost;
server_name ff-immobilier.localhost;
server_name leconnetable.localhost partenariat-immo.localhost vanoise-immo.localhost damiers-annecy.localhost;
server_name delastre-immobilier.localhost delastre-villeurbanne.localhost;
root '/home/chapa/Documents/Development/Client projects/agda/web';
client_max_body_size 1G;
location ~ ^/img/(?<photo>.+\.jpg)$ {
if (-f $request_filename) {
break;
}
return 301 http://$server_name/migrate/photo/?photo=$photo;
}
if (!-d $request_filename) {
# Redirection des urls commençant par app_dev.php/
rewrite ^/app_dev.php/(.*)$ /$1 permanent;
# Retrait du slash final
# rewrite ^/(.*)/$ /$1 permanent;
}
location / {
# try to serve file directly, fallback to app.php
try_files $uri /app_dev.php$is_args$args;
}
error_log /var/log/nginx/agda_errors.log;
access_log /var/log/nginx/agda_access.log;
include php.conf;
}
server {
listen 80;
charset utf-8;
server_name smart.jbf.localhost;
root "/home/chapa/Documents/Development/Client projects/jbf/web";
client_max_body_size 1000M;
location / {
try_files $uri /app_dev.php$is_args$args;
}
location ~ \.(css|js)\.map$ {
try_files $uri =404;
}
include php.conf;
error_log /var/log/nginx/jbf_errors.log;
access_log /var/log/nginx/jbf_access.log;
}
server {
listen 80;
charset utf-8;
server_name myapi.pharmanity.localhost;
root "/home/chapa/Documents/Development/Client projects/pharmanity-legacy/myapi.pharmanity.com/public";
location / {
try_files $uri /index.php$is_args$args;
}
location ~ \.(css|js)\.map$ {
try_files $uri =404;
}
include php.conf;
error_log /var/log/nginx/myapi-pharmanity_error.log;
access_log /var/log/nginx/myapi-pharmanity_access.log;
}
server {
listen 80;
charset utf-8;
server_name pma56.localhost;
location / {
proxy_pass http://phpmyadmin56;
}
error_log /var/log/nginx/phpmyadmin56_errors.log;
access_log /var/log/nginx/phpmyadmin56_access.log;
}
server {
listen 80;
charset utf-8;
server_name sudaquitainepharma.localhost;
root "/home/chapa/Documents/Development/Client projects/sudaquitainepharma/web";
client_max_body_size 1000M;
location / {
try_files $uri /app_dev.php$is_args$args;
}
location ~ \.(css|js)\.map$ {
try_files $uri =404;
}
include php.conf;
error_log /var/log/nginx/sudaquitainepharma_errors.log;
access_log /var/log/nginx/sudaquitainepharma_access.log;
}
server {
listen 80;
charset utf-8;
server_name synaps.localhost;
root "/home/chapa/Documents/Development/Client projects/synaps/web";
client_max_body_size 1000M;
location / {
try_files $uri /app_dev.php$is_args$args;
}
location ~ \.(css|js)\.map$ {
try_files $uri =404;
}
include php.conf;
error_log /var/log/nginx/synaps_errors.log;
access_log /var/log/nginx/synaps_access.log;
}
FROM php:7.2-fpm-alpine
# Upgrade packages
RUN apk update && apk upgrade
# Install native PHP extensions
RUN apk add \
bzip2-dev \
freetype-dev \
icu-dev \
libjpeg-turbo-dev \
libpng-dev \
libwebp-dev \
libxpm-dev \
&& docker-php-ext-install -j$(nproc) bcmath bz2 gd iconv intl mysqli opcache pdo_mysql sockets zip
# Install additionnal PHP extensions
RUN apk add \
$PHPIZE_DEPS \
imagemagick-dev \
libmcrypt-dev \
&& pecl install apcu-5.1.14 apcu_bc-1.0.4 imagick-3.4.3 mailparse-3.0.2 mcrypt-1.0.1 \
&& docker-php-ext-enable --ini-name 0-apc.ini apcu apc \
&& docker-php-ext-enable imagick mailparse mcrypt \
&& apk del $PHPIZE_DEPS
# Install composer
RUN curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://raw.githubusercontent.com/composer/getcomposer.org/b107d959a5924af895807021fcef4ffec5a76aa9/web/installer \
&& php -r " \
\$signature = '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061'; \
\$hash = hash('SHA384', file_get_contents('/tmp/installer.php')); \
if (!hash_equals(\$signature, \$hash)) { \
unlink('/tmp/installer.php'); \
echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \
exit(1); \
}" \
&& php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer --version=1.8.0 \
&& composer --ansi --version --no-interaction \
&& rm -rf /tmp/*
# Install compass
RUN apk add \
ruby \
ruby-dev \
ruby-rdoc \
libffi-dev \
build-base \
&& gem install compass -v 1.0.3 \
&& apk del \
build-base \
libffi-dev \
ruby-rdoc\
ruby-dev
# Insert user and group to be able to use `docker run` with `--user=chapa` param
RUN echo "chapa:x:1000:985::/home/chapa:/bin/ash" >> /etc/passwd \
&& echo "users:x:985:" >> /etc/group
apc.ttl=7200
date.timezone = Europe/Paris
display_errors = On
memory_limit = -1
Markdown is supported
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