From 473a527f1a6a979f85810e8c9093801041b785a3 Mon Sep 17 00:00:00 2001 From: Glenn Date: Thu, 18 Aug 2022 17:31:05 +0200 Subject: [PATCH] Initial import --- Dockerfile | 0 README.md | 14 ++++++++ docker-compose.yml | 88 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..8c40e32 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ + +## Setup on Dokku + + dokku apps:create cicd + dokku config:set cicd DRONE_DATABASE_DRIVER=sqlite3 + dokku config:set cicd DRONE_DATABASE_DATASOURCE=/data/database.sqlite + dokku config:set cicd DRONE_GIT_ALWAYS_AUTH="false" + dokku config:set cicd DRONE_RPC_SECRET=mFJCcUmWVictjhAug9rXc7bJxV4LsWrjR99jTvrwe9pR3ksK + dokku config:set cicd DRONE_SERVER_PROTO=http + dokku config:set cicd DRONE_TLS_AUTOCERT=false + dokku config:set cicd DRONE_SERVER_HOST=localhost:3001 + git remote add dokku dokku@dinlas.apps.glenux.net:cicd + git push + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9d3019f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,88 @@ +--- +version: '3.6' + +# References +# * https://www.alexhyett.com/drone-ci-raspberry-pi + +services: + # gitea: + # container_name: gitea + # image: gitea/gitea:${GITEA_VERSION:-1.10.6} + # restart: unless-stopped + # environment: + # # https://docs.gitea.io/en-us/install-with-docker/#environments-variables + # - APP_NAME="Gitea" + # - USER_UID=1000 + # - USER_GID=1000 + # - RUN_MODE=prod + # - DOMAIN=${IP_ADDRESS} + # - SSH_DOMAIN=${IP_ADDRESS} + # - HTTP_PORT=3000 + # - ROOT_URL=http://${IP_ADDRESS}:3000 + # - SSH_PORT=222 + # - SSH_LISTEN_PORT=22 + # - DB_TYPE=sqlite3 + # ports: + # - "3000:3000" + # - "222:22" + # networks: + # - cicd_net + # volumes: + # - ./gitea:/data + + drone: + container_name: drone + image: "drone/drone:${DRONE_VERSION:-2.12.1}" + restart: unless-stopped + depends_on: [] + environment: + # https://docs.drone.io/server/provider/gitea/ + - DRONE_DATABASE_DRIVER=sqlite3 + - DRONE_DATABASE_DATASOURCE=/data/database.sqlite + - DRONE_GIT_ALWAYS_AUTH="false" + - DRONE_RPC_SECRET="${DRONE_RPC_SECRET}" + - DRONE_SERVER_PROTO=http + - DRONE_SERVER_HOST="${IP_ADDRESS}:3001" + - DRONE_TLS_AUTOCERT="false" + - DRONE_USER_CREATE="${DRONE_USER_CREATE}" + # DRONE_GITEA_SERVER: "http://${IP_ADDRESS}:3000/" + # DRONE_GITEA_CLIENT_ID: "${DRONE_GITEA_CLIENT_ID}" + # DRONE_GITEA_CLIENT_SECRET: "${DRONE_GITEA_CLIENT_SECRET}" + ports: + - "3001:80" + - "9001:9000" + networks: + - cicd_net + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - ./drone:/data + + drone-runner: + container_name: drone-runner + image: drone/drone-runner-docker:${DRONE_RUNNER_VERSION:-1.8.2} + restart: unless-stopped + depends_on: + - drone + environment: + # https://docs.drone.io/runner/docker/installation/linux/ + # https://docs.drone.io/server/metrics/ + DRONE_RPC_PROTO: http + DRONE_RPC_HOST: drone + DRONE_RPC_SECRET: "${DRONE_RPC_SECRET}" + # DRONE_RUNNER_NAME: "${HOSTNAME}-runner" + DRONE_RUNNER_CAPACITY: 2 + DRONE_RUNNER_NETWORKS: cicd_net + DRONE_DEBUG: "false" + DRONE_TRACE: "false" + ports: + - "3002:3000" + networks: + - cicd_net + volumes: + - /var/run/docker.sock:/var/run/docker.sock + +networks: + cicd_net: + name: cicd_net + +#