Compare commits

..

2 Commits

Author SHA1 Message Date
steinhelge 0dba448f15 refactor: name CORS policy 'AllowFrontend'
Build & Push Hospitality / build-and-push (push) Failing after 2m57s
2025-11-26 12:43:45 +01:00
steinhelge 072935e133 config: Update API service connection string and add Traefik load balancer port configuration. 2025-11-26 12:41:59 +01:00
2 changed files with 9 additions and 7 deletions
+3 -2
View File
@@ -64,11 +64,12 @@ builder.Services.AddScoped<ITransactionService, TransactionService>();
// Add CORS // Add CORS
builder.Services.AddCors(options => builder.Services.AddCors(options =>
{ options.AddPolicy("AllowFrontend", policy =>
{
policy.SetIsOriginAllowed(origin => true) // Allow any origin policy.SetIsOriginAllowed(origin => true) // Allow any origin
.AllowAnyHeader() .AllowAnyHeader()
.AllowAnyMethod(); .AllowAnyMethod();
}); });
var app = builder.Build(); var app = builder.Build();
@@ -27,19 +27,20 @@ services:
restart: unless-stopped restart: unless-stopped
environment: environment:
ASPNETCORE_URLS: http://0.0.0.0:8080 ASPNETCORE_URLS: http://0.0.0.0:8080
# ASP.NET Core-style connection string via env: ConnectionStrings__DefaultConnection: "Host=db;Port=5432;Database=hospitality;Username=hospitality;Password=superhemmelig"
ConnectionStrings__Default: "Host=db;Port=5432;Database=hospitality;Username=hospitality;Password=supersecretpassword"
depends_on: depends_on:
- db - db
networks: networks:
- hospitality-net - hospitality-net
- edge - edge # eller hva prod-nettverket ditt heter
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.docker.network=edge" - "traefik.docker.network=edge"
- "traefik.http.routers.hospitality-api.rule=Host(`hospitality-api.theriise.net`)" - "traefik.http.routers.hospitality-api.rule=Host(`hospitality-api.theriise.net`)" # prod-domene
- "traefik.http.routers.hospitality-api.entrypoints=websecure" - "traefik.http.routers.hospitality-api.entrypoints=websecure"
- "traefik.http.routers.hospitality-api.tls=true" - "traefik.http.routers.hospitality-api.tls=true"
- "traefik.http.services.hospitality-api.loadbalancer.server.port=8080"
web: web:
image: gitea.theriise.net/steinhelge/hospitality-frontend:latest image: gitea.theriise.net/steinhelge/hospitality-frontend:latest