From 0167c5d8eb8431e6a86d36851791d3d8d5a37bd6 Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Tue, 29 Mar 2022 15:57:44 +0300 Subject: [PATCH] drone. draft. --- drone/.env.dist | 30 ++++++++++++++++++++++++++++++ drone/data/.gitignore | 2 ++ drone/docker-compose.yml | 19 +++++++++++++++++++ drone/nginx/drone.conf | 19 +++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 drone/.env.dist create mode 100644 drone/data/.gitignore create mode 100644 drone/docker-compose.yml create mode 100644 drone/nginx/drone.conf diff --git a/drone/.env.dist b/drone/.env.dist new file mode 100644 index 0000000..6f32896 --- /dev/null +++ b/drone/.env.dist @@ -0,0 +1,30 @@ +# see https://hub.docker.com/r/drone/drone +IMAGE_VERSION=2 + +HOST_DATA_DIR=./data + +WEBUI_BIND_ADDR=127.0.0.1 +WEBUI_BIND_PORT=8386 + +# Drone settings +# https://docs.drone.io/server/reference/ +DRONE_GITEA_SERVER=https://gitea.domain.tld +DRONE_GITEA_CLIENT_ID=xxx +DRONE_GITEA_CLIENT_SECRET=yyy +DRONE_RPC_SECRET=super-duper-secret +DRONE_SERVER_HOST=drone.domain.tld +DRONE_SERVER_PROTO=https + +#DRONE_DATABASE_DRIVER=mysql +#DRONE_DATABASE_DRIVER=postgres +DRONE_DATABASE_DRIVER=sqlite3 +#DRONE_DATABASE_DATASOURCE=root:password@tcp(1.2.3.4:3306)/drone?parseTime=true +#DRONE_DATABASE_DATASOURCE=postgres://root:password@1.2.3.4:5432/postgres?sslmode=disable +DRONE_DATABASE_DATASOURCE=/data/database.sqlite +# Optional string value. Configures the secret key used to encrypt secrets in the database. +# Encryption is disabled by default and must be configured before the system is first used. +#DRONE_DATABASE_SECRET=zzz + +# Service settings +LOG_MAX_SIZE=5m +LOG_MAX_FILE=5 \ No newline at end of file diff --git a/drone/data/.gitignore b/drone/data/.gitignore new file mode 100644 index 0000000..a68d087 --- /dev/null +++ b/drone/data/.gitignore @@ -0,0 +1,2 @@ +/* +!/.gitignore diff --git a/drone/docker-compose.yml b/drone/docker-compose.yml new file mode 100644 index 0000000..6466b25 --- /dev/null +++ b/drone/docker-compose.yml @@ -0,0 +1,19 @@ +# https://hub.docker.com/r/drone/drone +version: '3.7' + +services: + drone: + image: "drone/drone:${IMAGE_VERSION:-2}" + container_name: drone + hostname: drone + volumes: + - "${HOST_DATA_DIR:-./data}:/data" + ports: + - "${WEBUI_BIND_ADDR:-127.0.0.1}:${WEBUI_BIND_PORT:-8386}:80" + env_file: .env + restart: unless-stopped + logging: + driver: "json-file" + options: + max-size: "${LOG_MAX_SIZE:-5m}" + max-file: "${LOG_MAX_FILE:-5}" diff --git a/drone/nginx/drone.conf b/drone/nginx/drone.conf new file mode 100644 index 0000000..fb8dce3 --- /dev/null +++ b/drone/nginx/drone.conf @@ -0,0 +1,19 @@ +server { + listen 80; + server_name drone.domain.tld; + + #charset utf-8; + + location / { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $http_connection; + + proxy_pass http://127.0.0.1:8386/; + } +} \ No newline at end of file