Compare commits

..

5 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
4 changed files with 10 additions and 5 deletions
+3
View File
@@ -65,9 +65,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();
});
}); });
@@ -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:
@@ -56,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;