diff --git a/Dockerfile b/Dockerfile index 2df0781..de9f15e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ RUN apt-get update && apt-get upgrade -y \ nginx \ && apt-get clean -RUN pip3 install --no-cache-dir Flask PyMuPDF +RUN pip3 install --no-cache-dir Flask PyMuPDF Flask-Cors WORKDIR /app diff --git a/ec2.py b/ec2.py index fad1632..0c3e7f5 100644 --- a/ec2.py +++ b/ec2.py @@ -28,7 +28,7 @@ cd aws_faktury docker build -t flask-invoice-app . -docker run -d -p 8080:8080 flask-invoice-app +docker run -d -p 8080:8080 -p 80:80 flask-invoice-app echo "Aplikacja dziaƂa na porcie 8080" """ diff --git a/invoice_service.py b/invoice_service.py index b2e3a40..ad1f196 100644 --- a/invoice_service.py +++ b/invoice_service.py @@ -1,9 +1,11 @@ from flask import Flask, request, jsonify +from flask_cors import CORS import fitz import os import re app = Flask(__name__) +CORS(app) UPLOAD_FOLDER = 'uploads' os.makedirs(UPLOAD_FOLDER, exist_ok=True)