
提示
开发环境: nixos 24.05 docker 24.0.5 Jenkins 2.479.1 nginx 1.27.2 gitea 1.22.3
部署环境: ubuntu 22.04 docker 24.0.5
初始化环境
创建目录
mkdir -p local-ci-cd/gitea
mkdir -p local-ci-cd/Jenkins
mkdir -p local-ci-cd/nginx
cd local-ci-cd
2024/11/20大约 3 分钟

提示
开发环境: nixos 24.05 docker 24.0.5 Jenkins 2.479.1 nginx 1.27.2 gitea 1.22.3
部署环境: ubuntu 22.04 docker 24.0.5
mkdir -p local-ci-cd/gitea
mkdir -p local-ci-cd/Jenkins
mkdir -p local-ci-cd/nginx
cd local-ci-cd
重要
部署环境: ubuntu 20.04 docker 24.0.7 ubuntu/bind9 9.18.28
version: '3.3'
services:
example:
#image build二选一
image: mysql
build:
context: ./dir
dockerfile: Dockerfile-alternate
args:
buildno: 1
container_name: example
ports:
- "8000:80"
-
volumes:
- /software/mysql/logs:/var/log/mysql
-
environment:
EXMAPLE: 'example'
restart: always
#以下为高级配置
command: example
depends_on: example
networks:
- local
- default
devices:
- "/dev/ttyUSB0:/dev/ttyUSB0"
dns: 8.8.8.8
env_file: .env
external_links:other_contain
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost"]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
networks:
db:
external:
name: local
default:
driver: bridge
element是一款点对点加密软件,用于加密通信,好处是通信过程完全由自己掌控,包括通信资产以及通信质量。支持网站,app,windows&mac os&ios客户端,完全跨平台,以下教程均在docker内完成。
首先在vps安装docker(详情可在docker安装教程查看)。
当镜像文件改变的时候,首先停止容器:
docker-compose down
站点文件夹:/home/uulol/sites/uulol
访问域名:uulol.tc.2ceo.cn
a2ensite 开启站点
a2dissite 关闭站点
a2enconf 开启配置
a2disconf 关闭配置
创建站点文件夹:/home/uulol/sites/uulol
在/etc/apache2/site-available创建对应站点名称的网站配置文件:uulol.conf
将000-default.conf(默认配置文件)复制到uulol.conf
uulol.conf配置如下
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName uulol.tc.2ceo.cn #访问域名(自定义)
ServerAdmin webmaster@localhost #站点管理员
DocumentRoot /home/uulol/sites/uulol #站点文件夹(自定义)
#ServerName webreopen.tc.2ceo.cn
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
配置完成之后保存并使用
a2ensite uulol.conf #启用站点
systemctl reload apache2 #重启服务器
完成
运行以下命令:(这里默认已经安装了php)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e21205b207c3ff031906575712edab6f13eb0b361f2085f1f1237b7126d785e826a450292b6cfd1d64d92e6563bbde02') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer
docker images
首先根据这个网站更新apt库apt更新,然后再根据这个安装:docker安装
切勿在windows安装docker,以防出现不可预料的网络问题。
这是debian系的系统安装docker教程。
官网拷贝的示例:
命令行操作git仓库流程流程:
git clone <url>
git checkout -b dev-by-<name>
git add <文件>
git push origin dev-by-<name>
git fetch <branchName>
git pull origin dev-by-<name>