2 Commits

Author SHA1 Message Date
460b13c195 Changed to proxy
All checks were successful
Build and Push Docker Images / build-and-push-backend (push) Successful in 8s
Build and Push Docker Images / build-and-push-frontend (push) Successful in 15s
2026-01-31 01:16:48 +01:00
b77e1ce605 Docker Compose 2026-01-31 01:03:36 +01:00
3 changed files with 33 additions and 1 deletions

19
docker-compose.yml Normal file
View File

@@ -0,0 +1,19 @@
services:
backend:
image: git.out.jafre.li/jafreli/dashboard-backend:latest
container_name: dashboard-backend
# ports:
# - "8080:8080"
restart: unless-stopped
volumes:
- ./data/dashboard.db:/root/dashboard.db
frontend:
image: git.out.jafre.li/jafreli/dashboard-frontend:latest
container_name: dashboard-frontend
ports:
- "80:80"
restart: unless-stopped
depends_on:
- backend

View File

@@ -13,4 +13,17 @@ server {
# This is the key for making client-side routing work.
try_files $uri $uri/ /index.html;
}
# Add a new location block to proxy API requests
location /api/ {
# Forward the request to the backend service.
# The name 'backend' is resolved by Docker's internal DNS.
proxy_pass http://backend:8080;
# Set headers to pass along client information to the backend
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

View File

@@ -7,7 +7,7 @@ import { Item } from '../models/item';
providedIn: 'root'
})
export class ApiService {
private apiUrl = 'http://localhost:8080/api/items';
private apiUrl = '/api/items';
constructor(private http: HttpClient) { }