Docker LEMP
name | pulls | version | layers | image size |
---|---|---|---|---|
metowolf/php | ||||
metowolf/nginx | ||||
mysql/mysql-server | ||||
library/redis | ||||
phpmyadmin/phpmyadmin |
Requirements
Install Docker and Compose
Usage
Clone docker-lemp inside your projectgit clone https://github.com/metowolf/docker-lemp.git Enter the docker-lemp folder and rename .env.example to .env.
cd docker-lemp cp .env.example .env cp docker-compose.example.yml docker-compose.yml Open your project’s .env file and set the following:
MYSQL_ROOT_PASSWORD=your_password Run your containers:
docker-compose up -d
Running QUIC
The following configuration file can be used as a starting point to enable HTTP/3 support:
http { server { # Enable QUIC, HTTP/3 and HTTP/2 on both IPv4 and IPv6. listen 443 ssl http2; listen 443 quic; listen [::]:443 ssl http2; listen [::]:443 quic; ssl_certificate cert.crt; ssl_certificate_key cert.key; # Add HSTS header add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always; # Add Alt-Svc header to negotiate HTTP/3. add_header alt-svc 'h3-23=":443"; ma=86400'; # Enable specific TLS versions (TLSv1 and TLSv1.1 are not longer saft, TLSv1.3 is required for QUIC). ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers TLS-CHACHA20-POLY1305-SHA256:TLS-AES-256-GCM-SHA384:TLS-AES-128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256; ssl_prefer_server_ciphers on; ssl_early_data on; } }
Running brotli
Add the following lines into the configuration file of your sites to enable brotli
feature:
brotli on; brotli_comp_level 6; brotli_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/svg+xml;
Generally Upgrade
Modify project’s .env file.vim .env Rebuild containers:
docker-compose up -d --no-deps --build
Upgrade to Caddyless
version
Before git pull
Rename conflicted file if exists:
mv etc/nginx/nginx.conf etc/nginx/nginx.conf.bak
After git pull
Modify project’s .env file.
vim .env Move Nginx/MySQL/SSL configuration to new directory:
# move nginx configuration
mv etc/nginx/config/* etc/nginx/conf.d/
# move MySQL configuration
rm -fr etc/mysql && mkdir etc/mysql && mkdir etc/mysql/my.cnf.d
mv etc/database/data etc/mysql && mv etc/database/config/* etc/mysql/my.cnf.d
# move SSL configuration
mv etc/ssl etc/nginx
Rebuild containers and remove the Caddy
container:
docker-compose up -d --no-deps --build --remove-orphans
版权声明:
1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。2、网站不提供资料下载,如需下载请到原作者页面进行下载。
3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考学习用!
4、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。