Compare commits

...

8 Commits

Author SHA1 Message Date
s8613 495c3f6808 updated conf content security policy 2025-07-02 16:17:31 +02:00
s8613 5b36ce43a9 missing "/" added 2025-07-02 16:12:46 +02:00
s8613 7da4c51a89 fixed socket issue 2025-07-02 16:05:59 +02:00
s8613 26700d5be1 fixed copy past issue 2025-07-02 16:02:36 +02:00
s8613 ef78b079a7 changed base in vite.config 2025-07-02 15:48:15 +02:00
s8613 cbd5dcae92 config nginx 2025-07-02 15:27:15 +02:00
s8613 cee8de81e8 Docker-compose fixed api-host 2025-07-02 14:54:46 +02:00
s8613 508c2a1ba8 Docker-compose 2025-07-02 14:51:24 +02:00
5 changed files with 48 additions and 19 deletions

View File

@ -2,22 +2,32 @@ services:
frontend:
build:
context: frontend
ports:
- 8080:80
environment:
- API_HOST=http://localhost:5050
- API_HOST=http://ec2-3-121-130-58.eu-central-1.compute.amazonaws.com/ff-api
labels:
- "traefik.enable=true"
- "traefik.http.routers.ff-frontend.rule=PathPrefix(`/ff`)"
- "traefik.http.routers.ff-frontend.entrypoints=web"
- "traefik.http.services.ff-frontend.loadbalancer.server.port=80"
- "traefik.http.middlewares.ff-frontend-stripprefix.stripprefix.prefixes=/ff"
- "traefik.http.routers.ff-frontend.middlewares=ff-frontend-stripprefix"
networks:
- proxy
- app-network
db:
image: postgres:17-alpine
env_file:
- .env
# ports:
# - "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U admin"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- db_data:/var/lib/postgresql/data
networks:
- app-network
coordinator:
build:
@ -31,12 +41,20 @@ services:
db:
condition: service_healthy
healthcheck:
test: wget --spider --no-verbose http://127.0.0.1:5000/health || exit 1
test: wget --spider --no-verbose http://127.0.0.1:5000/health || exit 1
interval: 20s
timeout: 10s
retries: 10
ports:
- 5050:5000
labels:
- "traefik.enable=true"
- "traefik.http.routers.ff-api.rule=PathPrefix(`/ff-api`)"
- "traefik.http.routers.ff-api.entrypoints=web"
- "traefik.http.services.ff-api.loadbalancer.server.port=5000"
- "traefik.http.middlewares.ff-api-stripprefix.stripprefix.prefixes=/ff-api"
- "traefik.http.routers.ff-api.middlewares=ff-api-stripprefix"
networks:
- proxy
- app-network
ocr:
build:
@ -48,18 +66,18 @@ services:
- EXXETA_SERVICE_URL=http://exxeta:5000/extract
- SPACY_SERVICE_URL=http://spacy:5052/extract
- COORDINATOR_URL=http://coordinator:5000
ports:
- 5051:5000
networks:
- app-network
spacy:
build:
context: backend/spacy-service
environment:
- VALIDATE_SERVICE_URL=http://validate:5000/validate
ports:
- 5052:5052
volumes:
- ./backend/spacy-service/spacy_training:/app/spacy_training
networks:
- app-network
exxeta:
build:
@ -70,8 +88,8 @@ services:
environment:
- VALIDATE_SERVICE_URL=http://validate:5000/validate
- COORDINATOR_URL=http://coordinator:5000
ports:
- 5053:5000
networks:
- app-network
validate:
build:
@ -81,5 +99,14 @@ services:
- .env
environment:
- COORDINATOR_URL=http://coordinator:5000
ports:
- 5054:5000
networks:
- app-network
networks:
proxy:
external: true
app-network:
driver: bridge
volumes:
db_data:

View File

@ -4,6 +4,7 @@ server {
root /usr/share/nginx/html;
index index.html;
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data: https:; connect-src 'self' https:; object-src 'none'; media-src 'self'; frame-src 'self';";
# Caching configuration for static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires 30d;
@ -20,4 +21,4 @@ server {
location = /50x.html {
root /usr/share/nginx/html;
}
}
}

View File

@ -19,7 +19,7 @@ export default function UploadPage() {
const uploadFile = useCallback(async () => {
const formData = new FormData();
formData.append("file", files[0]);
const response = await fetch(`${API_HOST}/api/pitch_book`, {
const response = await fetch(`${API_HOST}/api/pitch_book/`, {
method: "POST",
body: formData,
});

View File

@ -6,5 +6,5 @@ import { API_HOST } from "./util/api";
const url = new URL(API_HOST);
export const socket = io(`${url.host}`, {
path: `${url.pathname.replace(/^\/+/, "")}/socket.io`,
path: `${url.pathname}/socket.io`,
});

View File

@ -4,6 +4,7 @@ import { defineConfig } from "vite";
// https://vitejs.dev/config/
export default defineConfig({
base: "/ff/",
plugins: [TanStackRouterVite({ autoCodeSplitting: true }), viteReact()],
build: {
chunkSizeWarningLimit: 1000, // default ist 500