From 89d2627a4789fa628e2bd32df0bdab555bffaec1 Mon Sep 17 00:00:00 2001 From: thek4n Date: Wed, 3 Jun 2026 15:08:57 +0300 Subject: [PATCH] ci: drone config --- .drone.yml | 53 +++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 2 +- docker-compose.yaml | 21 ++++++++++++++++++ 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 .drone.yml create mode 100644 docker-compose.yaml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..a797907 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,53 @@ +kind: pipeline +type: docker +name: docker-compose-deploy + +steps: + - name: dockerize + image: plugins/docker + environment: + DOCKER_BUILDKIT: 1 + settings: + repo: localhost:8091/thek4n/thek4n.ru + tags: + - latest + - ${DRONE_TAG} + dockerfile: Dockerfile + registry: localhost:8091 + insecure: true + build_args: + - APP_VERSION=${DRONE_TAG} + volumes: + - name: docker-socket + path: /var/run/docker.sock + when: + event: + - promote + target: + - production + - development + ref: + - refs/tags/* + + - name: deploy-to-production + image: appleboy/drone-ssh + settings: + host: + - 192.168.50.5 + username: thek4n + key: + from_secret: ssh_key + port: 22 + script: + - | + cd "/home/thek4n/services/thek4n.ru" && \ + IMAGE_TAG="${DRONE_TAG}" docker compose up -d + when: + event: + - promote + target: + - production + ref: + - refs/tags/* + depends_on: + - dockerize diff --git a/Dockerfile b/Dockerfile index a9992a9..de7a81a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,4 +34,4 @@ FROM scratch COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/thek4n-ru /usr/local/bin/thek4n-ru -CMD ["/usr/local/bin/thek4n-ru"] +CMD ["/usr/local/bin/thek4n-ru", "--host", "0.0.0.0", "--port", "80", "--config", "/configs/config.toml"] diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..258a73c --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,21 @@ +services: + paste: + build: + context: . + dockerfile: Dockerfile + + image: 'thek4n/thek4n.ru' + + pull_policy: build + + container_name: 'thek4n.ru' + + ports: + - 8081:80 + + restart: unless-stopped + + volumes: + - "/etc/timezone:/etc/timezone:ro" + - "/etc/localtime:/etc/localtime:ro" + - "./configs:/configs"