.drone.yml and docker-compose.yml fix
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2026-02-21 16:33:56 +03:00
parent 4d250a0c19
commit db504b0f15
2 changed files with 15 additions and 14 deletions

View File

@@ -4,49 +4,52 @@ name: default
steps: steps:
- name: go test - name: go test
image: golang:1.25-alpine3.21 image: golang:1.24-alpine3.21
commands: commands:
- apk add --no-cache git curl - apk add --no-cache git curl
- go mod tidy - go mod tidy
- go test ./... - go test ./...
- name: build docker image - name: build and push docker image
image: docker:24 image: docker:24
privileged: true
volumes: volumes:
- name: dockersock - name: dockersock
path: /var/run/docker.sock path: /var/run/docker.sock
commands: commands:
- docker build -t localhost:5000/link-shortener:latest -f dockerfile . - docker build -t localhost:5000/link-shortener:latest -f dockerfile .
- docker push localhost:5000/link-shortener:latest
- name: deploy with compose - name: deploy with compose
image: plugins/docker-compose image: docker:24
privileged: true
volumes: volumes:
- name: dockersock - name: dockersock
path: /var/run/docker.sock path: /var/run/docker.sock
- host: - name: appdir
path: ./ path: /opt/app
target: /opt/app
environment: environment:
IMAGE: localhost:5000/link-shortener:latest IMAGE: localhost:5000/link-shortener:latest
SERVER_HOST: link.dusiburg.ru SERVER_HOST: link.dusiburg.ru
VIRTUAL_HOST: link.dusiburg.ru VIRTUAL_HOST: link.dusiburg.ru
VIRTUAL_PORT: 80 VIRTUAL_PORT: 8080
LETSENCRYPT_HOST: link.dusiburg.ru LETSENCRYPT_HOST: link.dusiburg.ru
LETSENCRYPT_EMAIL: LETSENCRYPT_EMAIL:
from_secret: LETSENCRYPT_EMAIL from_secret: LETSENCRYPT_EMAIL
SERVER_PORT: 80 SERVER_PORT: 8080
REDIS_URL: redis://redis:6379 REDIS_URL: redis://redis:6379
commands: commands:
- apk add --no-cache docker-cli-compose
- cp -r . /opt/app
- cd /opt/app - cd /opt/app
- docker-compose pull - docker compose pull
- docker-compose up -d - docker compose up -d
volumes: volumes:
- name: dockersock - name: dockersock
host: host:
path: /var/run/docker.sock path: /var/run/docker.sock
- name: appdir
host:
path: /tmp/drone-app-deploy
trigger: trigger:
branch: branch:

View File

@@ -32,8 +32,6 @@ services:
container_name: link-shortener-redis container_name: link-shortener-redis
networks: [isolated] networks: [isolated]
restart: unless-stopped restart: unless-stopped
ports:
- "6379:6379"
volumes: volumes:
- redis_data:/data - redis_data:/data
command: ["redis-server", "--appendonly", "yes"] command: ["redis-server", "--appendonly", "yes"]