Compare commits
4 Commits
5f53207050
...
v0.0.3
| Author | SHA1 | Date | |
|---|---|---|---|
| ae8b60687a | |||
| 3fff8654fe | |||
| 9cfe9e2ab2 | |||
| fd799d6158 |
@@ -10,7 +10,7 @@ env:
|
|||||||
DOTNET_VERSION: '8.0.x'
|
DOTNET_VERSION: '8.0.x'
|
||||||
DOCKER_IMAGE_NAME: watcher-server
|
DOCKER_IMAGE_NAME: watcher-server
|
||||||
REGISTRY_URL: git.triggermeelmo.com
|
REGISTRY_URL: git.triggermeelmo.com
|
||||||
DOCKER_PLATFORMS: 'linux/amd64,linux/arm64'
|
DOCKER_PLATFORMS: 'linux/amd64'
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
@@ -115,10 +115,10 @@ jobs:
|
|||||||
- name: Build and Push Multi-Arch Docker Image
|
- name: Build and Push Multi-Arch Docker Image
|
||||||
run: |
|
run: |
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--platform ${{ env.DOCKER_PLATFORMS }} \
|
--platform linux/amd64 \
|
||||||
--build-arg VERSION=${{ needs.set-tag.outputs.tag_name }} \
|
--build-arg VERSION=${{ needs.set-tag.outputs.tag_name }} \
|
||||||
-t ${{ env.REGISTRY_URL }}/watcher/${{ env.DOCKER_IMAGE_NAME }}:${{ needs.set-tag.outputs.tag_name }} \
|
-t ${{ env.REGISTRY_URL }}/triggermeelmo/${{ env.DOCKER_IMAGE_NAME }}:${{ needs.set-tag.outputs.tag_name }} \
|
||||||
--push .
|
--push .
|
||||||
|
|
||||||
tag:
|
tag:
|
||||||
name: Create Tag
|
name: Create Tag
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
watcher:
|
watcher:
|
||||||
image: git.triggermeelmo.com/watcher/watcher-server:latest
|
image: git.triggermeelmo.com/triggermeelmo/watcher-server:latest
|
||||||
container_name: watcher
|
container_name: watcher
|
||||||
|
|
||||||
# Resource Management
|
# Resource Management
|
||||||
@@ -8,7 +8,6 @@ services:
|
|||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
memory: 200M
|
memory: 200M
|
||||||
cpus: '0.5'
|
|
||||||
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,31 @@ builder.Services.AddSwaggerGen(options =>
|
|||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
|
// Stelle sicher, dass das persistence-Verzeichnis existiert
|
||||||
|
var persistenceDir = Path.Combine(Directory.GetCurrentDirectory(), "persistence");
|
||||||
|
if (!Directory.Exists(persistenceDir))
|
||||||
|
{
|
||||||
|
Log.Information("Erstelle persistence-Verzeichnis: {PersistenceDir}", persistenceDir);
|
||||||
|
Directory.CreateDirectory(persistenceDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Datenbank-Migration beim Start ausführen
|
||||||
|
using (var scope = app.Services.CreateScope())
|
||||||
|
{
|
||||||
|
var dbContext = scope.ServiceProvider.GetRequiredService<WatcherDbContext>();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Log.Information("Führe Datenbank-Migrationen aus...");
|
||||||
|
dbContext.Database.Migrate();
|
||||||
|
Log.Information("Datenbank-Migrationen erfolgreich angewendet");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.Error(ex, "Fehler beim Ausführen der Datenbank-Migrationen");
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Configure the HTTP request pipeline.
|
// Configure the HTTP request pipeline.
|
||||||
if (!app.Environment.IsDevelopment())
|
if (!app.Environment.IsDevelopment())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user