init
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
aovantsev
2025-10-02 22:30:16 +03:00
parent fba4bb58f9
commit 0dcb5d9b87
7 changed files with 159 additions and 2 deletions

41
.drone.yml Normal file
View File

@@ -0,0 +1,41 @@
kind: pipeline
type: docker
name: default
steps:
- name: build-and-deploy
image: docker:20.10.16
environment:
DOCKER_HOST: unix:///var/run/docker.sock
volumes:
- name: docker-sock
path: /var/run/docker.sock
commands:
# Build the Docker image
- docker build -t localhost:5000/counter:latest .
# Push to local registry
- docker push localhost:5000/counter:latest
# Stop and remove existing container if it exists
- docker stop counter-app || true
- docker rm counter-app || true
# Run the new container
- docker run -d --name counter-app -p 8080:8080 localhost:5000/counter:latest
# Wait a moment for the container to start
- sleep 5
# Test the API
- curl -f http://localhost:8080/ || exit 1
volumes:
- name: docker-sock
host:
path: /var/run/docker.sock
trigger:
branch:
- main
- master