From a1118056843283d475d5e5682aa60deebfcc055e Mon Sep 17 00:00:00 2001 From: mac Date: Sun, 7 Nov 2021 13:51:53 -0500 Subject: [PATCH] python 3.9 changes --- .vscode/settings.json | 3 +++ Dockerfile | 11 +++++++++-- config.py | 2 +- docker-compose.yml | 2 +- requirements-pgsql.txt | 2 +- requirements.txt | 20 +++++++++++--------- runtime.txt | 2 +- 7 files changed, 27 insertions(+), 15 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3516cb9 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.formatting.provider": "autopep8" +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index cd47e91..1dc81dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,18 @@ -FROM python:3.6 +FROM python:3.9 ENV FLASK_APP run.py COPY run.py gunicorn-cfg.py requirements.txt config.py .env ./ COPY app app -RUN pip install -r requirements.txt +# set environment variables +ENV PYTHONDONTWRITEBYTECODE 1 +ENV PYTHONUNBUFFERED 1 + +# install python dependencies +RUN pip install --upgrade pip +RUN pip install --no-cache-dir -r requirements.txt EXPOSE 5005 +# gunicorn CMD ["gunicorn", "--config", "gunicorn-cfg.py", "run:app"] diff --git a/config.py b/config.py index 98f5a9e..e7742b9 100644 --- a/config.py +++ b/config.py @@ -35,7 +35,7 @@ class ProductionConfig(Config): SQLALCHEMY_DATABASE_URI = '{}://{}:{}@{}:{}/{}'.format( config( 'DB_ENGINE' , default='postgresql' ), config( 'DB_USERNAME' , default='postgres' ), - config( 'DB_PASS' , default='mypassword' ), + config( 'DB_PASS' , default='password' ), config( 'DB_HOST' , default='localhost' ), config( 'DB_PORT' , default=5432 ), config( 'DB_NAME' , default='appseed-flask' ) diff --git a/docker-compose.yml b/docker-compose.yml index 93e8b7d..8351e2d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3' +version: '3.8' services: appseed-app: restart: always diff --git a/requirements-pgsql.txt b/requirements-pgsql.txt index b52ba82..68d79e1 100644 --- a/requirements-pgsql.txt +++ b/requirements-pgsql.txt @@ -1,2 +1,2 @@ -r requirements.txt -psycopg2 +psycopg2-binary diff --git a/requirements.txt b/requirements.txt index 4e13054..d45e079 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,11 @@ -flask==1.1.2 -flask_login==0.5.0 -flask_migrate==2.7.0 -flask_wtf==0.14.3 -flask_sqlalchemy==2.4.4 -sqlalchemy==1.3.23 -email_validator==1.1.2 -python-decouple==3.4 -gunicorn==20.0.4 +flask +flask_login +flask_migrate +flask_wtf +flask_sqlalchemy +sqlalchemy +email_validator +python-decouple +gunicorn +jinja2 +babel diff --git a/runtime.txt b/runtime.txt index 5c557c3..a48890e 100644 --- a/runtime.txt +++ b/runtime.txt @@ -1 +1 @@ -python-3.6.10 +python-3.8.10