'更新部署脚本'

master
pan 4 years ago
parent 303ffad195
commit adc38ad94c
  1. 51
      .ssh/id_rsa
  2. 1
      .ssh/id_rsa.pub
  3. 2
      .ssh/known_hosts
  4. 17
      docker-compose.yml
  5. 2
      nginx_Dockerfile
  6. 37
      risk_cloud_backend_Dockerfile
  7. 23
      risk_cloud_fontend_Dockerfile
  8. 4
      site.conf

@ -0,0 +1,51 @@
-----BEGIN RSA PRIVATE KEY-----
MIIJKAIBAAKCAgEAmzM+4UcLVfTaZMnyKcZHtXY8Cf0lAowLIWuz4cyU9ubfy1Se
ZeIA1R3A6Py5BMcmOQt4ol8hwTiDkPFYtn9rrVMsq860t88gI8rceXN7ScbfnUGm
j81yFr4LFg+ImgAr1KGhaOt3+OcTMkzd5U2sqWqF99NtKssvNeTh8a5gJYAEL7Zy
0im7RQtg1uNWbF7XeANUztRP+ApZS0c1d8XZx45IwpxZD4AkeKg57Zc6x9qpSWDK
/XsX33ujUPwJIkyo1NW0OLNWMQxw/DGTzxN5L3ft6/EHAbulAY7tS+d7YoN4tWQ0
qtuTl2hLRuHsOHAx6ByiVMi5qwbpWfcYcJRSqG3LGWDxK03JTsFj/CMvtuiEgBCC
xmTE5MZz9JcUhBFttoorqKrFztp3bveZFcLg7ftJLWkudIVGqu+LcwW2rvqxwKSP
lbGRBWDyfeRHoahGijD9w4Fp8DyExMuzh39xHpAcrfe16sUKSDFgG8XPukFbP1BT
+8uqo+Ygi9nM5TgO+c4Txzk6iF+Q0a25J4ftIIL6TmV7w2ECSYTHLQoO5CO1TFXH
Cu5Ic9oirOENu39m9T/U2OYl6QA8dKUZcxUTX2MMmchNGMaL3MDRZUXHIwQ9kzek
l3uRrPIXV2Ml6r3idhIax+mHkeaT0dTOj42e3FwkGI8pTQzxcWZom00zqfMCAwEA
AQKCAgALjnVQMQoXDHR2rNLraWhNitBNrhvjZKovguWSGrm86NQhP9vLmliVhfGn
Z6ofQPUHqmMBNDQ/PwYM9Ou2KybJcTgSUwIB7dpmz+Q65u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lzdHAyNTYAAABBBJAisOIKjfjV9WOeQCzXjpmFc+uzttBMQII177HxhwI2lZQRV0R7+m6cbDsozhbVNHrGKMCfLQtPq+ksYO1MSxo=
|1|t+vW8KJB+wOBbiVeotYBP0klIwA=|6VGayOIhSWlvUR36Oc9ay5J6FAU= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJAisOIKjfjV9WOeQCzXjpmFc+uzttBMQII177HxhwI2lZQRV0R7+m6cbDsozhbVNHrGKMCfLQtPq+ksYO1MSxo=

@ -1,18 +1,23 @@
version: '3.8' version: '3.8'
services: services:
web: nginx:
image: nginx:1.19.5-alpine build:
context: ./
dockerfile: ./nginx_Dockerfile
ports: ['80:80'] ports: ['80:80']
volumes: ['data-volume:/RiskCloudBackend', './site.conf:/etc/nginx/conf.d/site.conf'] volumes: ['data-volume:/RiskCloudBackend', './site.conf:/etc/nginx/conf.d/site.conf']
links: [php, nodejs] links: [php, nodejs]
php: php:
build: ./risk_cloud_backend build:
volumes: ['data-volume:/RiskCloudBackend'] context: ./
dockerfile: ./risk_cloud_backend_Dockerfile
volumes: ['data-volume:/RiskCloudBackend','./.env:/RiskCloudBackend/.env']
links: [mysql] links: [mysql]
working_dir: /RiskCloudBackend working_dir: /RiskCloudBackend
volumes: ['./.env:/RiskCloudBackend/.env']
nodejs: nodejs:
build: ./risk_cloud_fontend build:
context: ./
dockerfile: ./risk_cloud_fontend_Dockerfile
working_dir: /RiskCloudFontend working_dir: /RiskCloudFontend
mysql: mysql:
image: mysql:8.0.22 image: mysql:8.0.22

@ -0,0 +1,2 @@
FROM nginx:1.19.5-alpine
RUN mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.bak

@ -0,0 +1,37 @@
FROM php:7.4.13-fpm-alpine3.12
#切换阿里云镜像源
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
##安装php扩展
#gd
RUN apk add freetype-dev libjpeg-turbo-dev libpng-dev && docker-php-ext-install gd
##zip
RUN apk add --no-cache libzip-dev && docker-php-ext-install zip
##pdo_mysql
RUN docker-php-ext-install pdo_mysql
#git
RUN apk add git openssh
#设置环境变量
ENV name=RiskCloudBackend
#拷贝公钥免密克隆仓库代码
COPY .ssh /root/.ssh
#拷贝到容器里的密钥需要修改权限才能正常使用
RUN chmod 400 /root/.ssh/id_rsa
#拷贝项目文件
RUN cd / && git clone git@gogs.kirito.cool:panqihua/${name}.git
#切换到项目目录
WORKDIR /${name}
#目录读写权限
RUN chmod +x /${name} -R
#授权php-fpm访问项目所有文件权限
RUN chown -R www-data:www-data *
#安装composer
RUN php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');" && \
php composer-setup.php && \
php -r "unlink('composer-setup.php');" && \
mv composer.phar /usr/local/bin/composer
ARG proxy
ENV proxy=$proxy
##设置代理,使用composer安装依赖
RUN export http_proxy=socks5://${proxy}:1080 && export https_proxy=socks5://${proxy}:1080 && composer install && composer dumpautoload
#设置服务器文件存储目录创建软链接
RUN php artisan storage:link

@ -0,0 +1,23 @@
FROM node:current-alpine
#切换阿里云镜像源
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk update
#git
RUN apk add git openssh
#拷贝git密钥免密克隆仓库代码
COPY .ssh /root/.ssh
#拷贝到容器里的密钥需要修改权限才能正常使用
RUN chmod 400 /root/.ssh/id_rsa
#设置环境变量
ENV name=RiskCloudFontend
#拷贝项目文件
RUN git clone git@gogs.kirito.cool:panqihua/${name}.git
##切换到项目目录
WORKDIR /${name}
#目录读写权限
RUN chmod +x /${name} -R && pwd && ls -la
##安装依赖
RUN npm install -g cnpm --registry=https://registry.npm.taobao.org && \
cnpm install next -g && \
cnpm install && \
cnpm run build
CMD /bin/ash -c 'cnpm run start'

@ -3,7 +3,7 @@ server {
server_name localhost; server_name localhost;
error_log /var/log/nginx/error.log; error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log; access_log /var/log/nginx/access.log;
root /code/public; root /RiskCloudBackend/public;
location / { location / {
proxy_pass http://nodejs:3000; proxy_pass http://nodejs:3000;
@ -14,7 +14,7 @@ server {
} }
location ~ /storage { location ~ /storage {
root /code/public/; root /RiskCloudBackend/public/;
} }
location ~ \.php$ { location ~ \.php$ {

Loading…
Cancel
Save