initial creation
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
FROM python:3.7.5-slim-buster
|
||||
MAINTAINER Nick Janetakis <nick.janetakis@gmail.com>
|
||||
|
||||
ENV INSTALL_PATH /snakeeyes
|
||||
RUN mkdir -p $INSTALL_PATH
|
||||
|
||||
WORKDIR $INSTALL_PATH
|
||||
|
||||
COPY requirements.txt requirements.txt
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD gunicorn -b 0.0.0.0:8000 --access-logfile - "snakeeyes.app:create_app()"
|
||||
@@ -0,0 +1 @@
|
||||
DEBUG = True
|
||||
@@ -0,0 +1,16 @@
|
||||
version: '2'
|
||||
|
||||
services:
|
||||
website:
|
||||
build: .
|
||||
command: >
|
||||
gunicorn -b 0.0.0.0:8000
|
||||
--access-logfile -
|
||||
--reload
|
||||
"snakeeyes.app:create_app()"
|
||||
environment:
|
||||
PYTHONUNBUFFERED: 'true'
|
||||
volumes:
|
||||
- '.:/snakeeyes'
|
||||
ports:
|
||||
- '8000:8000'
|
||||
@@ -0,0 +1 @@
|
||||
DEBUG = False
|
||||
@@ -0,0 +1,30 @@
|
||||
Flask==0.10.1
|
||||
|
||||
# Hello. This is Nick from the future (March 2019 to be exact). An emergency
|
||||
# addition had to be made below to fix an issue related to a recent version of
|
||||
# werkzeug. This library was not version locked in this file.
|
||||
#
|
||||
# The line below isn't covered on video, but it locks werkzeug to the latest
|
||||
# version that works with this course's code base. A future update video will
|
||||
# cover upgrading this package and more.
|
||||
werkzeug==0.14.1
|
||||
|
||||
# Hello. This is Nick from the future (Feb 2022 to be exact). A new addition
|
||||
# had to be made below to fix an issue related to the version of Flask
|
||||
# that we use. A new major version of both itsdangerous and markupsafe came up
|
||||
# that are no longer backwards compatible with our version of Flask.
|
||||
#
|
||||
# These packages are both dependencies of Flask and now we're locking them to
|
||||
# a specific version that works with our version of Flask.
|
||||
itsdangerous==1.1.0
|
||||
markupsafe==1.1.1
|
||||
|
||||
# Hello. This is Nick from the future (March 2022 to be exact). A new addition
|
||||
# had to be made below to fix an issue with a recent release of Jinja 3.1. It's
|
||||
# breaking all sorts of libraries, so let's lock it to a stable 3.0.X version.
|
||||
#
|
||||
# Jinja 2 is the HTML templating library that Flask uses.
|
||||
jinja2==3.0.3
|
||||
|
||||
# Application server for both development and production.
|
||||
gunicorn==19.4.5
|
||||
@@ -0,0 +1,24 @@
|
||||
from flask import Flask
|
||||
|
||||
|
||||
def create_app():
|
||||
"""
|
||||
Create a Flask application using the app factory pattern.
|
||||
|
||||
:return: Flask app
|
||||
"""
|
||||
app = Flask(__name__, instance_relative_config=True)
|
||||
|
||||
app.config.from_object('config.settings')
|
||||
app.config.from_pyfile('settings.py', silent=True)
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
"""
|
||||
Render a Hello World response.
|
||||
|
||||
:return: Flask response
|
||||
"""
|
||||
return 'Hello World!'
|
||||
|
||||
return app
|
||||
Reference in New Issue
Block a user