diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..433d25c --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +my_env* + +*.pyc +__pycache__/ + +instance/ + +.pytest_cache/ +.coverage +htmlcov/ + +dist/ +build/ +*.egg-info/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0bb9921 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM python:3.8 + +WORKDIR /usr/src/app + +COPY requirements.txt ./ +RUN pip install --no-cache-dir -r requirements.txt + +ENV FLASK_APP my_homepage +ENV FLASK_ENV production + +COPY . . + +CMD ["gunicorn", "-b", "0.0.0.0:5000", "my_homepage:create_app()"] diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..bc7f54f --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +graft flaskr/static +graft flaskr/templates +global-exclude *.pyc diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..43e035d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,6 @@ +version: '3' + +services: + app: + image: my_homepage + restart: unless-stopped diff --git a/my_homepage/__init__.py b/my_homepage/__init__.py new file mode 100644 index 0000000..cb77293 --- /dev/null +++ b/my_homepage/__init__.py @@ -0,0 +1,28 @@ +import os + +from flask import Flask, render_template + + +def create_app(test_config=None): + # create and configure the app + app = Flask(__name__, instance_relative_config=True) + + #if test_config is None: + # # load the instance config, if it exists, when not testing + # app.config.from_pyfile('config.py', silent=True) + #else: + # # load the test config if passed in + # app.config.from_mapping(test_config) + + ## ensure the instance folder exists + #try: + # os.makedirs(app.instance_path) + #except OSError: + # pass + + # a simple page that says hello + @app.route('/') + def index(): + return render_template('index.html') + + return app diff --git a/my_homepage/templates/index.html b/my_homepage/templates/index.html new file mode 100644 index 0000000..fd4fc9b --- /dev/null +++ b/my_homepage/templates/index.html @@ -0,0 +1,11 @@ + + +
+