Compare commits

..

No commits in common. "develop" and "v0.0.53" have entirely different histories.

7 changed files with 49 additions and 232 deletions

View File

@ -1,57 +0,0 @@
kind: pipeline
type: docker
name: test
steps:
- name: build
image: gong921123/debian-nginx-php114-74:latest
pull: if-not-exists
commands:
- composer -v
- ls -a
- composer install -v
- name: deploy-push-images
depends_on:
- build
image: plugins/docker
pull: if-not-exists
settings:
repo: registry.cn-shanghai.aliyuncs.com/gong92-socl/debian-nginx-php114-74-pro # 和dockerfile 分开
registry: registry.cn-shanghai.aliyuncs.com
insecure: true
username:
from_secret: aliyun_acr_username
password:
from_secret: aliyun_acr_password
dockerfile: docker/Dockerfile
tags: ${DRONE_TAG}
- name: deploy-pull-project
depends_on:
- deploy-push-images
image: appleboy/drone-ssh
pull: if-not-exists
settings:
host: 106.15.233.223
user:
from_secret: ssh_username
password:
from_secret: ssh_password
command_timeout: 5m
port: 22
script:
- echo ====开始部署=======
- docker stop $(docker ps | grep hyperf | awk '{print $1}')
- docker rm $(docker ps -a | grep hyperf | awk '{print $1}')
- docker rmi $(docker images | grep gong92-socl/debian-nginx-php114-74-pro | awk '{print $3}')
- docker pull registry.cn-shanghai.aliyuncs.com/gong92-socl/debian-nginx-php114-74-pro:${DRONE_TAG}
- docker run -itd --name hyperf -p 8001:8001 -v /var/projects:/var/www -v /usr/local/docker/vloumn_nginx:/etc/nginx/conf.d -v /etc/hosts:/etc/hosts --privileged=true registry.cn-shanghai.aliyuncs.com/gong92-socl/debian-nginx-php114-74-pro:${DRONE_TAG}
- echo ====部署成功=======
trigger:
# branch:
# - develop
event:
- tag
# - push

View File

@ -1,61 +0,0 @@
kind: pipeline
type: docker
name: test
steps:
- name: build
image: gong921123/debian-nginx-php114-74:latest
pull: if-not-exists
commands:
- composer -v
- ls -a
- composer install -v
- name: deploy-push-images
depends_on:
- build
image: plugins/docker
pull: if-not-exists
settings:
repo: gong921123/hyperfa # 这个地址明确了镜像最终要被推送并存储到的阿里云容器镜像仓库的具体位置 和下面的tag 构建完整的路径
registry: docker.io
insecure: true
username:
from_secret: docker_username
password:
from_secret: docker_password
dockerfile: docker/Dockerfile
tags: ${DRONE_TAG}
- name: deploy-pull-project
depends_on:
- deploy-push-images
image: appleboy/drone-ssh
pull: if-not-exists
settings:
host: 106.15.233.223
user:
from_secret: ssh_username
password:
from_secret: ssh_password
command_timeout: 5m
port: 22
script:
- echo ====开始部署=======
- docker pull gong921123/hyperfa:${DRONE_TAG}
- docker stop $(docker ps | grep hyperf | awk '{print $1}')
- docker rm $(docker ps | grep hyperf | awk '{print $1}')
- docker rmi $(docker images | grep gong921123/hyperf | awk '{print $3}')
- docker rmi $(docker images | grep "<none>" | awk '{print $3}')
- docker run -itd --name hyperf -p 8001:8001 -v /var/projects:/var/www -v /usr/local/docker/vloumn_nginx:/etc/nginx/conf.d
- -v /etc/hosts:/etc/hosts --privileged=true gong921123/hyperfa:${DRONE_TAG}
- echo ====部署成功=======
trigger:
# docker run -itd --name hyperf -p 8001:8001 registry.cn-shanghai.aliyuncs.com/gong92-socl/debian-nginx-php114-74:v2
# branch:
# - develop
event:
- tag
# - push

View File

@ -1,63 +0,0 @@
kind: pipeline
type: docker
name: test
steps:
- name: build
image: gong921123/debian-nginx-php114-74:latest
pull: if-not-exists
commands:
- composer -v
- ls -a
- composer install -v
- name: deploy-push-images
depends_on:
- build
commands:
- echo "Starting Docker image deployment..."
image: plugins/docker
pull: if-not-exists
settings:
repo: registry.cn-shanghai.aliyuncs.com/gong92-socl/debian-nginx-php114-74
registry: registry.cn-shanghai.aliyuncs.com
insecure: true
username:
from_secret: aliyun_acr_username
password:
from_secret: aliyun_acr_password
dockerfile: docker/Dockerfile
tags: ${DRONE_TAG}
- name: deploy-pull-project
depends_on:
- deploy-push-images
image: appleboy/drone-ssh
pull: if-not-exists
settings:
host: 106.15.233.223
user:
from_secret: ssh_username
password:
from_secret: ssh_password
command_timeout: 5m
port: 22
script:
- echo ====开始部署=======
- docker pull gong921123/hyperfa:${DRONE_TAG}
- docker stop $(docker ps | grep hyperf | awk '{print $1}')
- docker rm $(docker ps | grep hyperf | awk '{print $1}')
- docker rmi $(docker images | grep gong921123/hyperf | awk '{print $3}')
- docker rmi $(docker images | grep "<none>" | awk '{print $3}')
- docker run -itd --name hyperf -p 8001:8001 -v /var/projects:/var/www -v /usr/local/docker/vloumn_nginx:/etc/nginx/conf.d
- -v /etc/hosts:/etc/hosts --privileged=true gong921123/hyperfa:${DRONE_TAG}
- echo ====部署成功=======
trigger:
# branch:
# - develop
event:
- tag
# - push

23
.drone.yml Normal file → Executable file
View File

@ -17,13 +17,13 @@ steps:
image: plugins/docker
pull: if-not-exists
settings:
repo: registry.cn-shanghai.aliyuncs.com/gong92-socl/debian-nginx-php114-74-pro
registry: registry.cn-shanghai.aliyuncs.com
repo: gong921123/hyperfa
registry: docker.io
insecure: true
username:
from_secret: aliyun_acr_username
from_secret: docker_username
password:
from_secret: aliyun_acr_password
from_secret: docker_password
dockerfile: docker/Dockerfile
tags: ${DRONE_TAG}
@ -33,7 +33,7 @@ steps:
image: appleboy/drone-ssh
pull: if-not-exists
settings:
host: 106.15.233.223
host: gong.cool
user:
from_secret: ssh_username
password:
@ -42,16 +42,17 @@ steps:
port: 22
script:
- echo ====开始部署=======
- docker pull gong921123/hyperfa:${DRONE_TAG}
- docker stop $(docker ps | grep hyperf | awk '{print $1}')
- docker rm $(docker ps -a | grep hyperf | awk '{print $1}')
- docker rmi $(docker images | grep gong92-socl/debian-nginx-php114-74-pro | awk '{print $3}')
- docker pull registry.cn-shanghai.aliyuncs.com/gong92-socl/debian-nginx-php114-74-pro:${DRONE_TAG}
- docker run -itd --name hyperf -p 8001:8001 -v /var/projects:/var/www -v /usr/local/docker/vloumn_nginx:/etc/nginx/conf.d -v /etc/hosts:/etc/hosts --privileged=true registry.cn-shanghai.aliyuncs.com/gong92-socl/debian-nginx-php114-74-pro:${DRONE_TAG}
- docker rm $(docker ps | grep hyperf | awk '{print $1}')
- docker rmi $(docker images | grep gong921123/hyperf | awk '{print $3}')
- docker rmi $(docker images | grep "<none>" | awk '{print $3}')
- docker run -itd --name hyperf -p 8001:8001 -v /usr/local/docker/vloumn_nginx:/etc/nginx/conf.d -v /etc/hosts:/etc/hosts --privileged=true gong921123/hyperfa:${DRONE_TAG}
- echo ====部署成功=======
trigger:
# branch:
# - develop
# branch:
# - develop
event:
- tag
# - push

View File

@ -13,7 +13,7 @@ steps: # 定义管道的执行步骤
- pwd
- ls -a
- name: build # 步骤名称
image: gong921123/debian-nginx-php114-74:latest # 当前步骤使用的镜像 image: docker/compose 预先下载
image: gong921123/debian-nginx-php114-74:latest # 当前步骤使用的镜像 image: docker/compose
commands: # 当前步骤执行的命令
- composer -v
- ls -a

2
.env
View File

@ -5,7 +5,7 @@ APP_ENV=dev
DB_DRIVER=mysql
DB_HOST=106.15.233.223
DB_PORT=13306
DB_DATABASE=ghyperf-admin
DB_DATABASE=gitea
DB_USERNAME=root
DB_PASSWORD=root
DB_CHARSET=utf8mb4

View File

@ -1,18 +1,15 @@
FROM registry.cn-shanghai.aliyuncs.com/gong92-socl/hyperf3-php81-alpine-sw:v1
#FROM gong921123/debian-nginx-php114-74:latest
FROM gong921123/debian-nginx-php114-74:latest
# 复制当前目录的所有 到上面容器的 var/www中去变成一个新的镜像
# 要想复制其他文件 就必须把dockerfile和其他文件放一起
# 这里复制了这个项目的所有
RUN pwd && ls -a
COPY . /code
RUN ls -al /var/www
COPY . /var/www
# CMD不同于RUNCMD用于指定在容器启动时所要执行的命令而RUN用于指定镜像构建时所要执行的命令
# CMD只运行出现一次 多次出现只会执行最后一个
# 启动 hyperf 框架 并且 启动Nginx 服务器
#CMD ["php", "bin/hyperf.php", "start"]
#CMD ["nginx"]
CMD ["php", "bin/hyperf.php", "start"]
CMD ["nginx"]
#CMD php bin/hyperf.php start && nginx -g 'daemon off;'
#CMD php bin/hyperf.php start && nginx
# nginx -g 'daemon off;' 它将以前台模式运行,并将日志输出到终端