From 1843f449bd731a0a6be1285a38c05af39077aaa2 Mon Sep 17 00:00:00 2001 From: meliurwen Date: Sun, 21 Mar 2021 14:29:55 +0100 Subject: [PATCH] Initial fully working version --- .env.example | 17 ++++++++++++++++ .gitignore | 1 + docker-compose.yml | 38 ++++++++++++++++++++++++++++++++++ drone-agent.env.example | 27 ++++++++++++++++++++++++ drone-server.env.example | 44 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 127 insertions(+) create mode 100644 .env.example create mode 100644 .gitignore create mode 100644 docker-compose.yml create mode 100644 drone-agent.env.example create mode 100644 drone-server.env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..2036c7e --- /dev/null +++ b/.env.example @@ -0,0 +1,17 @@ +# Global Settings +LOCAL_STACK_DIR=/srv/docker/volumes/drone + +# Networks +NETWORK= + +# Drone Server +DRS_IMG= +DRS_TAG= +DRS_CONTAINER_NAME= +DRS_RESTART= + +# Drone Agent +DRA_IMG= +DRA_TAG= +DRA_CONTAINER_NAME= +DRA_RESTART= diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..03bd412 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.env diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..48db25a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,38 @@ +version: '3' + +services: + drone-server: + image: ${DRS_IMG:-drone/drone}:${DRS_TAG:-1} + container_name: ${DRS_CONTAINER_NAME:-drone-server} + restart: ${DRS_RESTART:-unless-stopped} + networks: + - default + - drone + volumes: + - ${LOCAL_STACK_DIR}/drone-server/data:/data + expose: + - 80 + env_file: + - drone-server.env + + drone-agent: + image: ${DRA_IMG:-drone/drone-runner-docker}:${DRA_TAG:-1} + container_name: ${DRA_CONTAINER_NAME:-drone-agent} + restart: ${DRA_RESTART:-unless-stopped} + networks: + - drone + volumes: + - /var/run/docker.sock:/var/run/docker.sock + expose: + - 3000 + depends_on: + - drone-server + env_file: + - drone-agent.env + +networks: + default: + external: + name: ${NETWORK:-webservices} + drone: + internal: false diff --git a/drone-agent.env.example b/drone-agent.env.example new file mode 100644 index 0000000..6fdac6d --- /dev/null +++ b/drone-agent.env.example @@ -0,0 +1,27 @@ +# Docs: https://docs.drone.io/runner/docker/configuration/reference/ + +# Drone Agent general settings +DRONE_RPC_PROTO=http +DRONE_RPC_HOST=drone-server +DRONE_RPC_SECRET= + +# Limits to prevent resource exhaustion (optional) +# Note: memory limits are in bytes +#DRONE_MEMORY_LIMIT=536870912 # 512 MiB +#DRONE_MEMORY_SWAP_LIMIT=0 +#DRONE_RUNNER_CAPACITY=2 +#DRONE_RUNNER_MAX_PROCS=2 + +# Agent name (optional) +#DRONE_RUNNER_NAME= + +# Danger Zone (optional) +# Note: do not touch if you don't know exactly what you are doing! +#DRONE_HTTP_BIND=:3000 +#DRONE_HTTP_HOST= +#DRONE_HTTP_PROTO= +#DRONE_UI_DISABLED= +#DRONE_UI_PASSWORD= + +#VIRTUAL_HOST=runner.domain.tld +#VIRTUAL_PORT=3000 diff --git a/drone-server.env.example b/drone-server.env.example new file mode 100644 index 0000000..a90c2c9 --- /dev/null +++ b/drone-server.env.example @@ -0,0 +1,44 @@ +# Docs: https://docs.drone.io/server/reference/ + +# Drone Server +DRONE_SERVER_HOST= +DRONE_SERVER_PROTO= +DRONE_RPC_SECRET= + +# Drone Server (required if behind a proxy) +DRONE_SERVER_PROXY_HOST= +DRONE_SERVER_PROXY_PROTO= + +# Drone behaviour to git (optional) +DRONE_GIT_ALWAYS_AUTH=true + +# Gitea Plugin (optional) +DRONE_GITEA_SERVER= +DRONE_GITEA_CLIENT_ID= +DRONE_GITEA_CLIENT_SECRET= + +# Give admin powers to specific existing users (optional) +DRONE_USER_CREATE= + +# Disables open registrations (optional) +DRONE_REGISTRATION_CLOSED=false + +# Limit registration to individual users and members of organizations (optional) +DRONE_USER_FILTER= + +# List of users and organizations used to limit which repos are syncronized (optional) +DRONE_REPOSITORY_FILTER= + +# Security (optional) +DRONE_HTTP_ALLOWED_HOSTS= +DRONE_HTTP_PROXY_HEADERS=Host +DRONE_HTTP_BROWSER_XSS_FILTER=true +DRONE_HTTP_FRAME_DENY=true +DRONE_HTTP_CONTENT_TYPE_NO_SNIFF=true +DRONE_HTTP_REFERRER_POLICY=same-origin + +# Reverse-proxy and certbot +VIRTUAL_HOST=sub.domain.tld +VIRTUAL_PORT=80 +LETSENCRYPT_HOST=sub.domain.tld +LETSENCRYPT_EMAIL=account@domain.tld