add watchtower to docker-compose and .env and gitea actions
Build and Push Docker Image / build-and-push (push) Successful in 2m10s

This commit is contained in:
2026-06-11 19:52:20 +01:00
parent 602343fd9f
commit 79dd76ecc7
3 changed files with 30 additions and 2 deletions
+4
View File
@@ -1,6 +1,10 @@
# Skopíruj tento súbor ako .env a vyplň hodnoty
# cp .env.example .env
# Docker Hub
DOCKERHUB_USERNAME=
WATCHTOWER_TOKEN=
# Databáza
DB_SERVER=192.168.1.68
DB_PORT=3306
+6
View File
@@ -29,3 +29,9 @@ jobs:
tags: ${{ secrets.DOCKERHUB_USERNAME }}/calendarreminder-app:latest
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/calendarreminder-app:buildcache
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/calendarreminder-app:buildcache,mode=max
- name: Trigger Watchtower deploy
run: |
curl -sf \
-H "Authorization: Bearer ${{ secrets.WATCHTOWER_TOKEN }}" \
http://${{ secrets.TRUENAS_IP }}:8085/v1/update
+19 -1
View File
@@ -1,8 +1,13 @@
services:
app:
build: .
image: ${DOCKERHUB_USERNAME}/calendarreminder-app:latest
ports:
- "8080:8080"
depends_on:
db:
condition: service_healthy
labels:
- "com.centurylinklabs.watchtower.enable=true"
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ConnectionStrings__Default=Server=${DB_SERVER};Port=${DB_PORT};Database=${DB_NAME};User=${DB_USER};Password=${DB_PASSWORD};
@@ -32,3 +37,16 @@ services:
timeout: 5s
retries: 5
restart: unless-stopped
watchtower:
image: containrrr/watchtower
ports:
- "8085:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- WATCHTOWER_LABEL_ENABLE=true
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_HTTP_API_UPDATE=true
- WATCHTOWER_HTTP_API_TOKEN=${WATCHTOWER_TOKEN}
restart: unless-stopped