Compare commits
72 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
aa41b9c2de | |
|
|
00b913c0c0 | |
|
|
5d67cd42ed | |
|
|
ce231f8739 | |
|
|
4e995f48b9 | |
|
|
978ede45b4 | |
|
|
e3383498b6 | |
|
|
596b49f844 | |
|
|
a032ce71f8 | |
|
|
a08cb6bd7c | |
|
|
2f05f7be08 | |
|
|
c5802b2204 | |
|
|
8a3cc2dd43 | |
|
|
9740f54ea7 | |
|
|
dd7c92ae1c | |
|
|
6334c2c29a | |
|
|
440639dd9c | |
|
|
dbca228ad6 | |
|
|
7c0514b749 | |
|
|
0737d3040c | |
|
|
79e5261826 | |
|
|
498e0e313a | |
|
|
2bde615913 | |
|
|
2e85e73991 | |
|
|
235260427d | |
|
|
279ef12a0b | |
|
|
1753ce0c76 | |
|
|
935d860570 | |
|
|
06d067616e | |
|
|
5c984bd78d | |
|
|
d0be313001 | |
|
|
e00acdbc44 | |
|
|
fe17fe2c5a | |
|
|
48c9779878 | |
|
|
40f446c582 | |
|
|
31b7c0ce9f | |
|
|
5e5a08340f | |
|
|
325f1fb88e | |
|
|
f804ef16f0 | |
|
|
4538dfb0ee | |
|
|
23984dc972 | |
|
|
9404216742 | |
|
|
fc19ba61fa | |
|
|
064a4c4321 | |
|
|
a4f157f876 | |
|
|
23844c7ac7 | |
|
|
fb8fa3740e | |
|
|
12508a814b | |
|
|
35d37028da | |
|
|
cff17288ed | |
|
|
8d04c0f1e5 | |
|
|
973be0f0dc | |
|
|
f25fbdf556 | |
|
|
60cdc9e5ac | |
|
|
feecd4b2ab | |
|
|
b22ad824e6 | |
|
|
a6daee2997 | |
|
|
2625ca3a16 | |
|
|
5c6edcc4de | |
|
|
34ed3df46b | |
|
|
b87a1fa970 | |
|
|
2972c6448f | |
|
|
f8669d9ecd | |
|
|
fff1793a5b | |
|
|
625386516b | |
|
|
7096ac1150 | |
|
|
cbbbf85977 | |
|
|
8f519ceb42 | |
|
|
7caafc89d1 | |
|
|
e63d9063c3 | |
|
|
f4bdf69bbb | |
|
|
b6aecca2e7 |
|
|
@ -0,0 +1,57 @@
|
||||||
|
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
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
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
|
||||||
|
|
@ -0,0 +1,63 @@
|
||||||
|
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
|
||||||
|
|
@ -3,56 +3,55 @@ type: docker
|
||||||
name: test
|
name: test
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build
|
- name: build
|
||||||
image: gong921123/debian-nginx-php114-74:latest
|
image: gong921123/debian-nginx-php114-74:latest
|
||||||
pull: if-not-exists
|
pull: if-not-exists
|
||||||
commands:
|
commands:
|
||||||
- composer -v
|
- composer -v
|
||||||
- ls -a
|
- ls -a
|
||||||
- composer install -v
|
- composer install -v
|
||||||
|
|
||||||
- name: deploy-push-images
|
- name: deploy-push-images
|
||||||
depends_on:
|
depends_on:
|
||||||
- build
|
- build
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
pull: if-not-exists
|
pull: if-not-exists
|
||||||
settings:
|
settings:
|
||||||
repo: gong921123/hyperfa
|
repo: registry.cn-shanghai.aliyuncs.com/gong92-socl/debian-nginx-php114-74-pro
|
||||||
registry: docker.io
|
registry: registry.cn-shanghai.aliyuncs.com
|
||||||
insecure: true
|
insecure: true
|
||||||
username:
|
username:
|
||||||
from_secret: docker_username
|
from_secret: aliyun_acr_username
|
||||||
password:
|
password:
|
||||||
from_secret: docker_password
|
from_secret: aliyun_acr_password
|
||||||
dockerfile: docker/Dockerfile
|
dockerfile: docker/Dockerfile
|
||||||
tags: ${DRONE_TAG}
|
tags: ${DRONE_TAG}
|
||||||
|
|
||||||
- name: deploy-pull-project
|
- name: deploy-pull-project
|
||||||
depends_on:
|
depends_on:
|
||||||
- deploy-push-images
|
- deploy-push-images
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
pull: if-not-exists
|
pull: if-not-exists
|
||||||
settings:
|
settings:
|
||||||
host: gong.cool
|
host: 106.15.233.223
|
||||||
user:
|
user:
|
||||||
from_secret: ssh_username
|
from_secret: ssh_username
|
||||||
password:
|
password:
|
||||||
from_secret: ssh_password
|
from_secret: ssh_password
|
||||||
command_timeout: 5m
|
command_timeout: 5m
|
||||||
port: 22
|
port: 22
|
||||||
script:
|
script:
|
||||||
- echo ====开始部署=======
|
- echo ====开始部署=======
|
||||||
- docker pull gong921123/hyperfa:${DRONE_TAG}
|
- docker stop $(docker ps | grep hyperf | awk '{print $1}')
|
||||||
- docker stop $(docker ps | grep hyperf | awk '{print $1}')
|
- docker rm $(docker ps -a | grep hyperf | awk '{print $1}')
|
||||||
- docker rm $(docker ps | grep hyperf | awk '{print $1}')
|
- docker rmi $(docker images | grep gong92-socl/debian-nginx-php114-74-pro | awk '{print $3}')
|
||||||
- docker rmi $(docker images | grep gong921123/hyperf | awk '{print $3}')
|
- docker pull registry.cn-shanghai.aliyuncs.com/gong92-socl/debian-nginx-php114-74-pro:${DRONE_TAG}
|
||||||
- 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 registry.cn-shanghai.aliyuncs.com/gong92-socl/debian-nginx-php114-74-pro:${DRONE_TAG}
|
||||||
- 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 ====部署成功=======
|
||||||
- echo ====部署成功=======
|
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
# branch:
|
# branch:
|
||||||
# - develop
|
# - develop
|
||||||
event:
|
event:
|
||||||
- tag
|
- tag
|
||||||
# - push
|
# - push
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ steps: # 定义管道的执行步骤
|
||||||
- pwd
|
- pwd
|
||||||
- ls -a
|
- ls -a
|
||||||
- name: build # 步骤名称
|
- name: build # 步骤名称
|
||||||
image: gong921123/debian-nginx-php114-74:latest # 当前步骤使用的镜像 image: docker/compose
|
image: gong921123/debian-nginx-php114-74:latest # 当前步骤使用的镜像 image: docker/compose 预先下载
|
||||||
commands: # 当前步骤执行的命令
|
commands: # 当前步骤执行的命令
|
||||||
- composer -v
|
- composer -v
|
||||||
- ls -a
|
- ls -a
|
||||||
|
|
|
||||||
2
.env
2
.env
|
|
@ -5,7 +5,7 @@ APP_ENV=dev
|
||||||
DB_DRIVER=mysql
|
DB_DRIVER=mysql
|
||||||
DB_HOST=106.15.233.223
|
DB_HOST=106.15.233.223
|
||||||
DB_PORT=13306
|
DB_PORT=13306
|
||||||
DB_DATABASE=gitea
|
DB_DATABASE=ghyperf-admin
|
||||||
DB_USERNAME=root
|
DB_USERNAME=root
|
||||||
DB_PASSWORD=root
|
DB_PASSWORD=root
|
||||||
DB_CHARSET=utf8mb4
|
DB_CHARSET=utf8mb4
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,18 @@
|
||||||
FROM gong921123/debian-nginx-php114-74:latest
|
FROM registry.cn-shanghai.aliyuncs.com/gong92-socl/hyperf3-php81-alpine-sw:v1
|
||||||
|
#FROM gong921123/debian-nginx-php114-74:latest
|
||||||
# 复制当前目录的所有 到上面容器的 var/www中去,变成一个新的镜像
|
# 复制当前目录的所有 到上面容器的 var/www中去,变成一个新的镜像
|
||||||
# 要想复制其他文件 就必须把dockerfile和其他文件放一起
|
# 要想复制其他文件 就必须把dockerfile和其他文件放一起
|
||||||
# 这里复制了这个项目的所有
|
# 这里复制了这个项目的所有
|
||||||
|
RUN pwd && ls -a
|
||||||
|
COPY . /code
|
||||||
|
RUN ls -al /var/www
|
||||||
|
|
||||||
COPY . /var/www
|
|
||||||
|
|
||||||
# CMD不同于RUN,CMD用于指定在容器启动时所要执行的命令,而RUN用于指定镜像构建时所要执行的命令
|
# CMD不同于RUN,CMD用于指定在容器启动时所要执行的命令,而RUN用于指定镜像构建时所要执行的命令
|
||||||
# CMD只运行出现一次 多次出现只会执行最后一个
|
# CMD只运行出现一次 多次出现只会执行最后一个
|
||||||
# 启动 hyperf 框架 并且 启动Nginx 服务器
|
# 启动 hyperf 框架 并且 启动Nginx 服务器
|
||||||
CMD ["php", "bin/hyperf.php", "start"]
|
#CMD ["php", "bin/hyperf.php", "start"]
|
||||||
CMD ["nginx"]
|
#CMD ["nginx"]
|
||||||
#CMD php bin/hyperf.php start && nginx -g 'daemon off;'
|
#CMD php bin/hyperf.php start && nginx -g 'daemon off;'
|
||||||
#CMD php bin/hyperf.php start && nginx
|
#CMD php bin/hyperf.php start && nginx
|
||||||
# nginx -g 'daemon off;' 它将以前台模式运行,并将日志输出到终端
|
# nginx -g 'daemon off;' 它将以前台模式运行,并将日志输出到终端
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue