- Init with local img

This commit is contained in:
Vincent BRIDIER 2021-11-29 18:39:40 +01:00
commit 98d66cd227
7 changed files with 2258 additions and 0 deletions

67
PHP7.3/Dockerfile Normal file
View file

@ -0,0 +1,67 @@
FROM php:7.3-apache
RUN apt-get update -qq && \
apt-get install -qy \
# Common
nano \
vim \
# GD
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libwebp-dev \
libxpm-dev \
# INTL
zlib1g-dev libicu-dev g++ \
# XSL
libxslt-dev \
# ZIP
libzip-dev \
unzip \
zip \
# Imagick
libmagick++-dev \
libmagickwand-dev \
# Memcached
libmemcached-dev
RUN docker-php-ext-configure gd \
--with-gd \
--with-webp-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib-dir \
--with-xpm-dir \
--with-freetype-dir
RUN docker-php-ext-configure intl
RUN docker-php-ext-configure zip --with-libzip
RUN docker-php-ext-install exif gd gettext intl mysqli pdo_mysql xsl opcache zip
RUN pecl install imagick-3.6.0 && docker-php-ext-enable imagick
RUN pecl install memcached-3.1.5 && docker-php-ext-enable memcached
# DEV
# TODO : https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/laravel + https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/vscode
RUN apt-get install -qy git zsh && sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
RUN pecl install xdebug && docker-php-ext-enable xdebug
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN curl -fsSL https://deb.nodesource.com/setup_17.x | bash -
RUN apt-get install -y nodejs
## DEV
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN useradd -ms /bin/bash noroot
COPY conf/php.ini /usr/local/etc/php/conf.d/app.ini
COPY conf/vhost.conf /etc/apache2/sites-available/000-default.conf
COPY conf/apache.conf /etc/apache2/conf-available/z-app.conf
COPY conf/ports.conf /etc/apache2/ports.conf
COPY conf/security.conf /etc/apache2/conf-enabled/security.conf
RUN a2enmod rewrite remoteip && \
a2enconf z-app
USER noroot
WORKDIR /app/srcs

116
PHP7.3/conf/apache.conf Normal file
View file

@ -0,0 +1,116 @@
ServerName dockerldcweb
User noroot
Group noroot
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300
#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On
#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100
#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5
#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
# Block .git composer and npm files
<FilesMatch "^composer\.(json|lock)">
Require all denied
</FilesMatch>
<FilesMatch "^package(-lock)?\.json">
Require all denied
</FilesMatch>
<FilesMatch "^\.">
Require all denied
</FilesMatch>
<DirectoryMatch "^\.|\/\.">
Require all denied
</Directorymatch>
#
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value. If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
# It is also possible to omit any default MIME type and let the
# client's browser guess an appropriate action instead. Typically the
# browser will decide based on the file's extension then. In cases
# where no good assumption can be made, letting the default MIME type
# unset is suggested instead of forcing the browser to accept
# incorrect metadata.
#
DefaultType None
#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log
#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
SetEnvIf Remote_Addr "127\.0\.0\.1" loopback
SetEnvIf Request_URI "^/haproxytest\.txt$" dontlog
SetEnvIf Request_URI "^check_http" dontlog
SetEnvIf Remote_Addr "127.0.0.1" dontlog
SetEnvIf Remote_Addr "::1" dontlog
# Include generic snippets of statements
SetEnvIf Remote_Addr "127\.0\.0\.1" loopback
SetEnvIf Request_URI "^/haproxytest\.txt$" dontlog

1943
PHP7.3/conf/php.ini Normal file

File diff suppressed because it is too large Load diff

15
PHP7.3/conf/ports.conf Normal file
View file

@ -0,0 +1,15 @@
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
Listen 80
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

74
PHP7.3/conf/security.conf Normal file
View file

@ -0,0 +1,74 @@
#
# Disable access to the entire file system except for the directories that
# are explicitly allowed later.
#
# This currently breaks the configurations that come with some web application
# Debian packages.
#
#<Directory />
# AllowOverride None
# Order Deny,Allow
# Deny from all
#</Directory>
# Changing the following options will not really affect the security of the
# server, but might make attacks slightly more difficult in some cases.
#
# ServerTokens
# This directive configures what you return as the Server HTTP response
# Header. The default is 'Full' which sends information about the OS-Type
# and compiled in modules.
# Set to one of: Full | OS | Minimal | Minor | Major | Prod
# where Full conveys the most information, and Prod the least.
#ServerTokens Minimal
ServerTokens Prod
#ServerTokens Full
#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory
# listings, mod_status and mod_info output etc., but not CGI generated
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of: On | Off | EMail
#ServerSignature Off
ServerSignature Off
#
# Allow TRACE method
#
# Set to "extended" to also reflect the request body (only for testing and
# diagnostic purposes).
#
# Set to one of: On | Off | extended
TraceEnable Off
#TraceEnable On
#
# Forbid access to version control directories
#
# If you use version control systems in your document root, you should
# probably deny access to their directories. For example, for subversion:
#
#<DirectoryMatch "/\.svn">
# Require all denied
#</DirectoryMatch>
#
# Setting this header will prevent MSIE from interpreting files as something
# else than declared by the content type in the HTTP headers.
# Requires mod_headers to be enabled.
#
#Header set X-Content-Type-Options: "nosniff"
#
# Setting this header will prevent other sites from embedding pages from this
# site as frames. This defends against clickjacking attacks.
# Requires mod_headers to be enabled.
#
#Header set X-Frame-Options: "sameorigin"
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

20
PHP7.3/conf/vhost.conf Normal file
View file

@ -0,0 +1,20 @@
<VirtualHost *:80>
ServerAdmin contact@ldc.fr
ServerName ${SERVERNAME}
DocumentRoot /app/${DOCUMENTROOT}
<Directory /app/>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
php_admin_value open_basedir /app/
php_admin_value upload_tmp_dir /app/tmp
php_admin_value error_log /app/logs/app_error_${PROJECT}.log
SetEnvIf X_FORWARDED_PROTO https HTTPS=on
</Directory>
ErrorLog /app/logs/error_${PROJECT}.log
CustomLog /app/logs/access_${PROJECT}.log combined
</VirtualHost>

23
PHP7.3/readme.md Normal file
View file

@ -0,0 +1,23 @@
# LDCWEB Docker Images - PHP 7.3
## Build
Pour build une image, il faut faire la commande suivante :
```sh
docker build -t [NOM IMAGE]:[VERSION IMAGE] .
```
Exemple :
```sh
docker build -t ldcweb-dev:1.0 .
```
## Paramètres obligatoires pour run l'image
```sh
SERVERNAME (ex: toto.test)
DOCUMENTROOT (ex: srcs ou srcs/public)
PROJECT (ex: toto)
```