.drone.yml and docker-compose.yml fix
Some checks failed
continuous-integration/drone/push Build encountered an error
Some checks failed
continuous-integration/drone/push Build encountered an error
This commit is contained in:
37
.drone.yml
37
.drone.yml
@@ -10,19 +10,34 @@ steps:
|
|||||||
- go mod tidy
|
- go mod tidy
|
||||||
- go test ./...
|
- go test ./...
|
||||||
|
|
||||||
- name: build and push
|
- name: build docker image
|
||||||
image: plugins/docker
|
image: docker:24
|
||||||
settings:
|
privileged: true
|
||||||
repo: localhost:5000/link-shortener
|
|
||||||
insecure: true
|
|
||||||
tags: latest
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: dockersock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
path: /var/run/docker.sock
|
commands:
|
||||||
|
- docker build -t localhost:5000/link-shortener:latest -f dockerfile .
|
||||||
|
|
||||||
services:
|
- name: deploy with compose
|
||||||
- name: redis
|
image: docker/compose:2.22.0
|
||||||
image: redis:latest
|
privileged: true
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
- ./:/opt/app
|
||||||
|
environment:
|
||||||
|
IMAGE: localhost:5000/link-shortener:latest
|
||||||
|
SERVER_HOST: link.dusiburg.ru
|
||||||
|
VIRTUAL_HOST: link.dusiburg.ru
|
||||||
|
VIRTUAL_PORT: 80
|
||||||
|
LETSENCRYPT_HOST: link.dusiburg.ru
|
||||||
|
LETSENCRYPT_EMAIL:
|
||||||
|
from_secret: LETSENCRYPT_EMAIL
|
||||||
|
SERVER_PORT: 80
|
||||||
|
REDIS_URL: redis://redis:6379
|
||||||
|
commands:
|
||||||
|
- cd /opt/app
|
||||||
|
- docker-compose pull
|
||||||
|
- docker-compose up -d
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: dockersock
|
- name: dockersock
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
services:
|
services:
|
||||||
link-shortener:
|
link-shortener:
|
||||||
build:
|
image: ${IMAGE}
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
container_name: link-shortener-app
|
container_name: link-shortener-app
|
||||||
networks: [isolated]
|
networks:
|
||||||
|
- isolated
|
||||||
|
- proxy
|
||||||
depends_on:
|
depends_on:
|
||||||
redis:
|
redis:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
@@ -13,13 +13,13 @@ services:
|
|||||||
expose:
|
expose:
|
||||||
- 8080
|
- 8080
|
||||||
environment:
|
environment:
|
||||||
- SERVER_HOST=localhost
|
- SERVER_HOST=${SERVER_HOST}
|
||||||
- VIRTUAL_HOST=link.dusiburg.ru
|
- VIRTUAL_HOST=${VIRTUAL_HOST}
|
||||||
- VIRTUAL_PORT=8080
|
- VIRTUAL_PORT=${VIRTUAL_PORT}
|
||||||
- LETSENCRYPT_HOST=link.dusiburg.ru
|
- LETSENCRYPT_HOST=${LETSENCRYPT_HOST}
|
||||||
- LETSENCRYPT_EMAIL=rezcjikov@mail.ru
|
- LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}
|
||||||
- SERVER_PORT=8080
|
- SERVER_PORT=${SERVER_PORT}
|
||||||
- REDIS_URL=redis://redis:6379
|
- REDIS_URL=${REDIS_URL}
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-fsS", "http://localhost:8080/ping"]
|
test: ["CMD", "curl", "-fsS", "http://localhost:8080/ping"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
@@ -51,3 +51,5 @@ volumes:
|
|||||||
networks:
|
networks:
|
||||||
isolated:
|
isolated:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
proxy:
|
||||||
|
external: true
|
||||||
Reference in New Issue
Block a user