Compare commits

..

No commits in common. "deployment_final" and "main" have entirely different histories.

5 changed files with 19 additions and 48 deletions

View File

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

View File

@ -4,7 +4,6 @@ server {
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.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 # Caching configuration for static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires 30d; expires 30d;
@ -21,4 +20,4 @@ server {
location = /50x.html { location = /50x.html {
root /usr/share/nginx/html; root /usr/share/nginx/html;
} }
} }

View File

@ -19,7 +19,7 @@ export default function UploadPage() {
const uploadFile = useCallback(async () => { const uploadFile = useCallback(async () => {
const formData = new FormData(); const formData = new FormData();
formData.append("file", files[0]); 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", method: "POST",
body: formData, body: formData,
}); });

View File

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

View File

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