diff --git a/.drone.yml b/.drone.yml index 1765124..74fde7e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,49 +4,52 @@ name: default steps: - name: go test - image: golang:1.25-alpine3.21 + image: golang:1.24-alpine3.21 commands: - apk add --no-cache git curl - go mod tidy - go test ./... - - name: build docker image + - name: build and push docker image image: docker:24 - privileged: true volumes: - name: dockersock path: /var/run/docker.sock commands: - docker build -t localhost:5000/link-shortener:latest -f dockerfile . + - docker push localhost:5000/link-shortener:latest - name: deploy with compose - image: plugins/docker-compose - privileged: true + image: docker:24 volumes: - name: dockersock path: /var/run/docker.sock - - host: - path: ./ - target: /opt/app + - name: appdir + path: /opt/app environment: IMAGE: localhost:5000/link-shortener:latest SERVER_HOST: link.dusiburg.ru VIRTUAL_HOST: link.dusiburg.ru - VIRTUAL_PORT: 80 + VIRTUAL_PORT: 8080 LETSENCRYPT_HOST: link.dusiburg.ru LETSENCRYPT_EMAIL: from_secret: LETSENCRYPT_EMAIL - SERVER_PORT: 80 + SERVER_PORT: 8080 REDIS_URL: redis://redis:6379 commands: + - apk add --no-cache docker-cli-compose + - cp -r . /opt/app - cd /opt/app - - docker-compose pull - - docker-compose up -d + - docker compose pull + - docker compose up -d volumes: - name: dockersock host: path: /var/run/docker.sock + - name: appdir + host: + path: /tmp/drone-app-deploy trigger: branch: diff --git a/docker-compose.yml b/docker-compose.yml index 478b9fd..0c174bd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -32,8 +32,6 @@ services: container_name: link-shortener-redis networks: [isolated] restart: unless-stopped - ports: - - "6379:6379" volumes: - redis_data:/data command: ["redis-server", "--appendonly", "yes"]