From 41ffb4d3bbb0d5236a3a1c5b075c34f57ff9ffcf Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Mon, 24 May 2021 17:08:41 +0800 Subject: [PATCH] update Former-commit-id: 369b2f6084694a413ef91ce4f24ab0c2fe37f3bb Former-commit-id: 46a5f9c41d35ec70392234119e7c150f24cd9784 --- labs/example/docker-compose.yml | 30 ++++++++++++++++ labs/example/start.cmd | 2 ++ labs/example/test/docker-compose.yml | 11 +++--- labs/gogs/.env | 2 ++ labs/gogs/.gitignore | 3 ++ labs/gogs/conf/gogs/app.ini | 51 ++++++++++++++++++++++++++++ labs/gogs/docker-compose.yml | 48 ++++++++++++++++++++++++++ 7 files changed, 142 insertions(+), 5 deletions(-) create mode 100644 labs/example/docker-compose.yml create mode 100644 labs/example/start.cmd create mode 100644 labs/gogs/.env create mode 100644 labs/gogs/.gitignore create mode 100644 labs/gogs/conf/gogs/app.ini create mode 100644 labs/gogs/docker-compose.yml diff --git a/labs/example/docker-compose.yml b/labs/example/docker-compose.yml new file mode 100644 index 00000000..1f331579 --- /dev/null +++ b/labs/example/docker-compose.yml @@ -0,0 +1,30 @@ +version: "3.8" +networks: + default: + name: mynetwork + driver: bridge + ipam: + config: + - subnet: 172.172.0.0/24 +services: + portainer: + image: portainer/portainer-ce:2.5.0 + restart: always + ports: + - 9000:9000 + volumes: + - /var/run/docker.sock:/var/run/docker.sock + #- portainer_data:/data + networks: + default: + ipv4_address: 172.172.0.9 + deploy: + replicas: 1 +# volumes: +# portainer_data: +# driver: vieux/sshfs:latest +# driver_opts: +# sshcmd: root@192.168.100.144:/root +# port: 2222 +# password: root +# allow_other: "" diff --git a/labs/example/start.cmd b/labs/example/start.cmd new file mode 100644 index 00000000..86c8b5e1 --- /dev/null +++ b/labs/example/start.cmd @@ -0,0 +1,2 @@ +docker network rm mynetwork +docker network create --driver overlay --subnet 172.172.0.0/24 --gateway 172.172.0.1 mynetwork \ No newline at end of file diff --git a/labs/example/test/docker-compose.yml b/labs/example/test/docker-compose.yml index c3dc0bf0..a519cd4b 100644 --- a/labs/example/test/docker-compose.yml +++ b/labs/example/test/docker-compose.yml @@ -1,10 +1,11 @@ version: "3.8" services: - sshfs: - image: gjyoung1974/alpine-sshd:latest + nfs: + image: itsthenetwork/nfs-server-alpine:12 + privileged: true ports: - - 1234:22 + - 2049:2049 environment: - - ROOT_PASSWORD=root + - SHARED_DIRECTORY=/nfsshare volumes: - - ../fs:/datacd \ No newline at end of file + - ../fs:/nfsshare diff --git a/labs/gogs/.env b/labs/gogs/.env new file mode 100644 index 00000000..66b79e86 --- /dev/null +++ b/labs/gogs/.env @@ -0,0 +1,2 @@ +TZ=Asia/Shanghai +IP=192.168.100.144 \ No newline at end of file diff --git a/labs/gogs/.gitignore b/labs/gogs/.gitignore new file mode 100644 index 00000000..c225f2a6 --- /dev/null +++ b/labs/gogs/.gitignore @@ -0,0 +1,3 @@ +.vscode +log +data \ No newline at end of file diff --git a/labs/gogs/conf/gogs/app.ini b/labs/gogs/conf/gogs/app.ini new file mode 100644 index 00000000..0b3de10a --- /dev/null +++ b/labs/gogs/conf/gogs/app.ini @@ -0,0 +1,51 @@ +BRAND_NAME = Gogs +RUN_USER = git +RUN_MODE = prod + +[database] +TYPE = sqlite3 +HOST = 127.0.0.1:5432 +NAME = gogs +USER = gogs +PASSWORD = +SSL_MODE = disable +PATH = data/gogs.db + +[repository] +ROOT = /data/git/gogs-repositories + +[server] +DOMAIN = localhost +HTTP_PORT = 3000 +EXTERNAL_URL = http://localhost:3000/ +DISABLE_SSH = false +SSH_PORT = 22 +START_SSH_SERVER = false +OFFLINE_MODE = false + +[mailer] +ENABLED = false + +[service] +REGISTER_EMAIL_CONFIRM = false +ENABLE_NOTIFY_MAIL = false +DISABLE_REGISTRATION = false +ENABLE_CAPTCHA = true +REQUIRE_SIGNIN_VIEW = false + +[picture] +DISABLE_GRAVATAR = false +ENABLE_FEDERATED_AVATAR = false + +[session] +PROVIDER = file + +[log] +MODE = file +LEVEL = Info +ROOT_PATH = /app/gogs/log + +[security] +INSTALL_LOCK = true +SECRET_KEY = fTLjOexokHUf7Re + diff --git a/labs/gogs/docker-compose.yml b/labs/gogs/docker-compose.yml new file mode 100644 index 00000000..f45da229 --- /dev/null +++ b/labs/gogs/docker-compose.yml @@ -0,0 +1,48 @@ +version: "3.8" +services: + gogs: + image: gogs/gogs:0.12.3 + #restart: always + environment: + - TZ=${TZ} + volumes: + - ./conf/gogs:/data/gogs/conf/ + - ./data/gogs:/data + - ./log/gogs:/app/gogs/log + ports: + - 1022:22 + - 3000:3000 + drone-server: + image: drone/drone:2.0.0 + #restart: always + environment: + - TZ=${TZ} + - DRONE_AGENTS_ENABLED=true + - DRONE_GOGS_SERVER=http://gogs:3000 + - DRONE_RPC_SECRET=123456 + - DRONE_SERVER_HOST=drone-server + - DRONE_SERVER_PROTO=http + volumes: + - ./data/drone:/data + ports: + - 8000:80 + depends_on: + - gogs + drone-runner: + image: drone/drone-runner-docker:1.6.3 + #restart: always + environment: + - TZ=${TZ} + - DRONE_RPC_PROTO=http + - DRONE_RPC_HOST=drone-server + - DRONE_RPC_SECRET=123456 + - DRONE_RUNNER_NAME="${IP}-runner" + - DRONE_RUNNER_CAPACITY=2 + - DRONE_DEBUG=false + - DRONE_TRACE=false + volumes: + - /var/run/docker.sock:/var/run/docker.sock + ports: + - 3000:3000 + depends_on: + - drone-server \ No newline at end of file