Compare commits

8 Commits

Author SHA1 Message Date
steinhelge 1ff03552ea config: Adjust Nginx listening address, explicitly set Traefik service ports for dev and prod, and rename the dev connection string key.
Build & Push Hospitality / build-and-push (push) Successful in 4m39s
2025-11-26 21:48:02 +01:00
steinhelge 63eb33a8c9 refactor: enclose CORS policy configuration in a block statement
Build & Push Hospitality / build-and-push (push) Successful in 3m13s
2025-11-26 15:47:06 +01:00
steinhelge f5f56b0407 fix: Correct api service indentation and remove inline comments.
Build & Push Hospitality / build-and-push (push) Failing after 3m19s
2025-11-26 15:36:24 +01:00
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
steinhelge c3750239c7 feat: configure Traefik load balancer for hospitality-dev-api to use port 8080
Build & Push Hospitality / build-and-push (push) Failing after 3m8s
2025-11-26 12:33:18 +01:00
steinhelge d1568c788a config: Allow all origins in CORS policy and disable HTTPS redirection.
Build & Push Hospitality / build-and-push (push) Failing after 2m4s
2025-11-26 12:07:31 +01:00
steinhelge dcc8e10bd2 config: Expand CORS policy to include development and production frontend URLs.
Build & Push Hospitality / build-and-push (push) Successful in 3m5s
2025-11-26 11:48:38 +01:00
4 changed files with 10 additions and 7 deletions
+2 -2
View File
@@ -67,7 +67,7 @@ builder.Services.AddCors(options =>
{ {
options.AddPolicy("AllowFrontend", policy => options.AddPolicy("AllowFrontend", policy =>
{ {
policy.WithOrigins("http://localhost:5173") policy.SetIsOriginAllowed(origin => true) // Allow any origin
.AllowAnyHeader() .AllowAnyHeader()
.AllowAnyMethod(); .AllowAnyMethod();
}); });
@@ -97,7 +97,7 @@ if (app.Environment.IsDevelopment())
app.UseSwaggerUI(); app.UseSwaggerUI();
} }
app.UseHttpsRedirection(); // app.UseHttpsRedirection(); // Disabled because Traefik handles SSL
app.UseCors("AllowFrontend"); app.UseCors("AllowFrontend");
@@ -27,7 +27,7 @@ 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
ConnectionStrings__Default: "Host=db;Port=5432;Database=hospitality_dev;Username=hospitality_dev;Password=devpassword" ConnectionStrings__DefaultConnection: "Host=db;Port=5432;Database=hospitality_dev;Username=hospitality_dev;Password=devpassword"
depends_on: depends_on:
- db - db
networks: networks:
@@ -39,6 +39,7 @@ services:
- "traefik.http.routers.hospitality-dev-api.rule=Host(`hospitality-dev-api.theriise.net`)" - "traefik.http.routers.hospitality-dev-api.rule=Host(`hospitality-dev-api.theriise.net`)"
- "traefik.http.routers.hospitality-dev-api.entrypoints=websecure" - "traefik.http.routers.hospitality-dev-api.entrypoints=websecure"
- "traefik.http.routers.hospitality-dev-api.tls=true" - "traefik.http.routers.hospitality-dev-api.tls=true"
- "traefik.http.services.hospitality-dev-api.loadbalancer.server.port=8080"
web: web:
image: gitea.theriise.net/steinhelge/hospitality-frontend:dev image: gitea.theriise.net/steinhelge/hospitality-frontend:dev
@@ -55,6 +56,7 @@ services:
- "traefik.http.routers.hospitality-dev.rule=Host(`hospitality-dev.theriise.net`)" - "traefik.http.routers.hospitality-dev.rule=Host(`hospitality-dev.theriise.net`)"
- "traefik.http.routers.hospitality-dev.entrypoints=websecure" - "traefik.http.routers.hospitality-dev.entrypoints=websecure"
- "traefik.http.routers.hospitality-dev.tls=true" - "traefik.http.routers.hospitality-dev.tls=true"
- "traefik.http.services.hospitality-dev.loadbalancer.server.port=80"
volumes: volumes:
hospitality-dev-db-data: hospitality-dev-db-data:
@@ -27,8 +27,7 @@ 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:
@@ -40,6 +39,7 @@ services:
- "traefik.http.routers.hospitality-api.rule=Host(`hospitality-api.theriise.net`)" - "traefik.http.routers.hospitality-api.rule=Host(`hospitality-api.theriise.net`)"
- "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
@@ -56,6 +56,7 @@ services:
- "traefik.http.routers.hospitality.rule=Host(`hospitality.theriise.net`)" - "traefik.http.routers.hospitality.rule=Host(`hospitality.theriise.net`)"
- "traefik.http.routers.hospitality.entrypoints=websecure" - "traefik.http.routers.hospitality.entrypoints=websecure"
- "traefik.http.routers.hospitality.tls=true" - "traefik.http.routers.hospitality.tls=true"
- "traefik.http.services.hospitality.loadbalancer.server.port=80"
volumes: volumes:
hospitality-db-data: hospitality-db-data:
+2 -2
View File
@@ -1,6 +1,6 @@
server { server {
listen 80; listen 0.0.0.0:80;
server_name localhost; server_name _;
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.html; index index.html;