diff --git a/cope2n-api/fwd_api/api/ctel_view.py b/cope2n-api/fwd_api/api/ctel_view.py index e487b01..999ae17 100755 --- a/cope2n-api/fwd_api/api/ctel_view.py +++ b/cope2n-api/fwd_api/api/ctel_view.py @@ -118,7 +118,7 @@ class CtelViewSet(viewsets.ViewSet): 'type': 'string' }, }, - 'required': {'imei_files', 'invoice_file'} + 'required': {'imei_files'} } }, responses=None, tags=['ocr']) @action(detail=False, url_path="images/process", methods=["POST"]) diff --git a/cope2n-api/fwd_api/celery_worker/internal_task.py b/cope2n-api/fwd_api/celery_worker/internal_task.py index 20a77ac..d79bca8 100755 --- a/cope2n-api/fwd_api/celery_worker/internal_task.py +++ b/cope2n-api/fwd_api/celery_worker/internal_task.py @@ -99,11 +99,10 @@ def process_pdf(rq_id, sub_id, p_type, user_id, files): _b_urls = process_pdf_file(file["file_name"], file["file_path"], new_request, user) if _b_urls is None: raise FileContentInvalidException - for i in range(len(_b_urls)): - _b_urls[i]["doc_type"] = file["file_type"] - # b_urls += _b_urls # TODO: Client may request all images in a file, for now, extract the first page only - for j in range(len(b_urls)): + for j in range(len(_b_urls)): + _b_urls[j]["doc_type"] = file["file_type"] _b_urls[j]["page_number"] = j + len(b_urls) + # b_urls += _b_urls # TODO: Client may request all images in a file, for now, extract the first page only b_urls.append(_b_urls[0]) elif extension in image_extensions: this_url = ProcessUtil.process_image_local_file(file["file_name"], file["file_path"], new_request, user)[0] diff --git a/cope2n-api/fwd_api/request/HealcheckSerializer.py b/cope2n-api/fwd_api/request/HealcheckSerializer.py old mode 100644 new mode 100755 diff --git a/cope2n-fe/nginx.conf b/cope2n-fe/nginx.conf index 8de3819..0eaf6a8 100644 --- a/cope2n-fe/nginx.conf +++ b/cope2n-fe/nginx.conf @@ -7,9 +7,13 @@ server { #access_log /var/log/nginx/host.access.log main; location ~ ^/api { - proxy_pass {{proxy_server}}; + proxy_pass {{proxy_server}}; } + location /static/drf_spectacular_sidecar/ { + alias /backend-static/drf_spectacular_sidecar/; + } + location / { root /usr/share/nginx/html; index index.html index.htm; diff --git a/docker-compose.yml b/docker-compose.yml index 0b097e4..291f5d3 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -40,7 +40,7 @@ services: context: cope2n-api dockerfile: Dockerfile ports: - - 9886:9000 + - 9880:9000 image: sidp/cope2n-be-fi-sbt container_name: "sidp-cope2n-be-ctel-manulife-sbt" environment: @@ -75,6 +75,7 @@ services: volumes: - ${HOST_MEDIA_FOLDER}:${MEDIA_ROOT} - ./cope2n-api:/app + - BE_static:/app/static # - sqlite_data:/app/ working_dir: /app # depends_on: @@ -177,6 +178,29 @@ services: - RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER} - RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS} # Front-end services + fe-sbt: + build: + context: cope2n-fe + shm_size: 10gb + dockerfile: Dockerfile + shm_size: 10gb + image: sidp/cope2n-fe-fi-sbt + container_name: "sidp-cope2n-fe-ctel-sbt" + privileged: true + ports: + - 9881:80 + depends_on: + be-ctel-manulife-sbt: + condition: service_started + be-celery-manulife-sbt: + condition: service_started + environment: + # - VITE_PROXY=http://be-ctel-manulife-sbt:${BASE_PORT} + - VITE_PROXY=http://42.96.42.13:9880 + - VITE_API_BASE_URL=http://fe-sbt:80 + volumes: + - BE_static:/backend-static + # Front-end services fe: build: context: cope2n-fe @@ -190,6 +214,7 @@ services: - 9882:80 environment: - VITE_PROXY=http://be-ctel-manulife-sbt:${BASE_PORT} + # - VITE_PROXY=http://42.96.42.13:9880 - VITE_API_BASE_URL=http://fe:80 networks: @@ -197,4 +222,5 @@ services: volumes: db_data: rabbitmq_data: - sqlite_data: \ No newline at end of file + sqlite_data: + BE_static: \ No newline at end of file