本帖最后由 dgiuobin 于 2018-10-15 22:24 编辑
SSH登陆armbian 新建mariadb数据库 - docker run --name mariadb -e MYSQL_ROOT_PASSWORD=你设置的密码 -p 3360:3306 -d mariadb:latest
复制代码
新建adminer数据库管理 - docker run --name adminer --link mariadb:db -p 8080:8080 arm64v8/adminer
复制代码 在浏览器打开 http://armbian地址:8080 登陆
新建php-fpm - docker run --name nginx-php-fpm \-v nginx-web:/var/www/html \-p 8000:9000 \-d arm64v8/php:7.2-fpm
复制代码
再到容器下运行命令
- docker-php-ext-install pdo pdo_mysql
复制代码
新建nginx
- docker run --name nginx \-v nginx-web:/usr/share/nginx/html \-v nginx-conf.d:/etc/nginx \-v nginx-ssl:/ssl \--link nginx-php-fpm:nginx-php-fpm \-p 81:80 \-d nginx:latest
复制代码
nginx-web 文件夹:网站文件 nginx-conf.d 文件夹:网站配置文件 ssl 文件夹:证书文件,名为server.pem 和 server.key
用WinSCP登陆armbian 修改 NGINX /var/lib/docker/volumes/nginx/_data/conf.d/default.conf 为下面代码- server {
- listen 80;
- listen 443 ssl;
- server_name localhost;
- ssl on; #如果强制HTTPs访问,这行要打开
- ssl_certificate /ssl/server.pem;
- ssl_certificate_key /ssl/server.key;
- ssl_session_cache shared:SSL:1m;
- ssl_session_timeout 5m;
- # 指定密码为openssl支持的格式
- ssl_protocols SSLv2 SSLv3 TLSv1.2;
- ssl_ciphers HIGH:!aNULL:!MD5; # 密码加密方式
- ssl_prefer_server_ciphers on; # 依赖SSLv3和TLSv1协议的服务器密码将优先于客户端密码
- #charset koi8-r;
- #access_log /var/log/nginx/host.access.log main;
- location / {
- root /usr/share/nginx/html;
- index index.html index.htm index.php;
- }
- #error_page 404 /404.html;
- # redirect server error pages to the static page /50x.html
- #
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root /usr/share/nginx/html;
- }
- # proxy the PHP scripts to Apache listening on 127.0.0.1:80
- #
- #location ~ \.php$ {
- # proxy_pass <a href="http://127.0.0.1" target="_blank">http://127.0.0.1</a>;
- #}
- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
- #
- location ~ \.php$ {
- root html;
- fastcgi_pass nginx-php-fpm:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name;
- include fastcgi_params;
- }
- # deny access to .htaccess files, if Apache's document root
- # concurs with nginx's one
- #
- #location ~ /\.ht {
- # deny all;
- #}
- }
复制代码
|