diff --git a/.github/workflows/build-project.yml b/.github/workflows/build-project.yml index 40e5fe5..b99deb9 100644 --- a/.github/workflows/build-project.yml +++ b/.github/workflows/build-project.yml @@ -6,7 +6,7 @@ on: jobs: build-project: env: - IMAGE_TAG: 3.4 + IMAGE_TAG: 3.5 runs-on: ubuntu-latest steps: - name: Get branch names @@ -36,4 +36,4 @@ jobs: uses: docker/build-push-action@v5 with: push: true - tags: kingstonduo/atlas-file-service:${{ steps.branch-names.outputs.current_branch }} \ No newline at end of file + tags: kingstonduo/atlas-file-service:${{ steps.branch-names.outputs.current_branch }} diff --git a/Dockerfile b/Dockerfile index d3b7c18..596a59a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,4 +7,4 @@ COPY app.py app.py COPY requirements.txt requirements.txt RUN pip3 install -r requirements.txt RUN pip3 install -U flask-cors -CMD ["gunicorn", "-b", ":5000", "app:app"] \ No newline at end of file +CMD ["uwsgi", "--http-socket", "0.0.0.0:5000", "--socket-timeout", "600", "--processes", "4", "--threads", "2", "--wsgi-file", "app.py", "--callable", "app"] diff --git a/app.py b/app.py index f4f6044..f645708 100644 --- a/app.py +++ b/app.py @@ -8,6 +8,7 @@ import mysql.connector import logging import requests +from werkzeug.wsgi import FileWrapper import json app = Flask(__name__) @@ -128,7 +129,15 @@ def downloadFile(packageId, objectName): }] } requests.post(url, json=payload, headers={"Content-Type": "application/json"}) - return send_file(object, as_attachment=True, download_name=objectName) + file_wrapper = FileWrapper(object) + headers = { + 'Content-Disposition': 'attachment; filename="{}"'.format(objectName) + } + response = Response(file_wrapper, + mimetype='application/octet-stream', + direct_passthrough=True, + headers=headers) + return response except S3Error as err: logger.error(err) return err diff --git a/changelog.md b/changelog.md index 56eefcd..d1c0f9a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,7 @@ # Changelog ## Release 3.4 (10/3/2024) + Brief summary of what's in this release: - GA download event added @@ -8,4 +9,5 @@ Brief summary of what's in this release: None ### Non-breaking changes -None + +Just a place to keep track of things that have changed in the code that we may want to pay special attention to when smoke testing, etc. diff --git a/requirements.txt b/requirements.txt index 1ed6d31..0aad9f5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,4 @@ boto3 flask-cors mysql-connector-python requests -gunicorn \ No newline at end of file +uwsgi \ No newline at end of file