updating docker deployment

This commit is contained in:
dtomlinson
2020-02-18 16:50:40 +00:00
parent 3572973077
commit adb0859ae1
12 changed files with 188 additions and 13 deletions

View File

@@ -138,3 +138,4 @@ dmypy.json
*node_modules
*font-awesome
*.mp4
*docker-image

View File

@@ -0,0 +1,8 @@
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7
RUN ["pip", "install", "aiofiles", "jinja2" ]
COPY ./app /app
COPY ./node_modules /node_modules
COPY ./bower_components /bower_components
COPY ./static /static

BIN
grandnational-dashboard/app/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1 @@
__version__ = '0.1.0'

View File

@@ -0,0 +1,32 @@
from starlette.applications import Starlette
from starlette.templating import Jinja2Templates
from starlette.routing import Route, Mount
from starlette.staticfiles import StaticFiles
templates = Jinja2Templates(directory='templates')
async def home(request):
return templates.TemplateResponse(
'index.html',
{'request': request},
)
routes = [
Route('/', endpoint=home),
Mount('/static', StaticFiles(directory='../static'), name='static'),
Mount(
'/node_modules',
StaticFiles(directory='../node_modules'),
name='node_modules',
),
Mount(
'/bower_components',
StaticFiles(directory='../bower_components'),
name='bower_components',
),
]
app = Starlette(debug=True, routes=routes)

View File

@@ -0,0 +1,102 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Capacity Dashboard</title>
<meta name="description" content="Capacity Dashboard">
<meta name="author" content="capacity">
<!-- favicon -->
<link rel="shortcut icon" href="{{ url_for('static', path='assets/favicon/favicon-192x192-wh.png')}}">
<!-- custom css -->
<link rel="stylesheet" href="{{ url_for('static', path='/css/gn.css')}}">
<!-- bootstrap css -->
{# <link rel="stylesheet" type="text/css" href="{{ url_for('static', path='/css/bootstrap.css') }}"> #}
<link rel="stylesheet" type="text/css" href="{{ url_for('node_modules', path='/bootswatch/dist/flatly/bootstrap.css') }}">
<!-- fakeLoader -->
<link rel="stylesheet" type="text/css" href="{{ url_for('node_modules', path='/jq-fakeloader/css/fakeLoader.css')}}">
<!-- Morphist -->
<link rel="stylesheet" type="text/css" href="{{ url_for('bower_components', path='/Morphist/dist/morphist.css') }}">
<!-- Animate.css -->
<link rel="stylesheet" type="text/css" href="{{ url_for('bower_components', path='/animate.css/animate.min.css') }}">
</head>
<body>
<!-- jquery js -->
<script type="text/javascript" src="{{ url_for('static', path='/js/jquery-3.4.1.js') }}"></script>
<!-- bootstrap js -->
<script type="text/javascript" src="{{ url_for('static', path='/js/bootstrap.bundle.js') }}"></script>
<!-- font-awesome js -->
<script type="text/javascript" src="{{ url_for('node_modules', path='/@fortawesome/fontawesome-free/js/all.js')}}"></script>
<!-- fakeLoader -->
<script type="text/javascript" src="{{ url_for('node_modules', path='/jq-fakeloader/js/fakeLoader.js') }}"></script>
<!-- final countdown -->
<script type="text/javascript" src="{{ url_for('bower_components', path='/jquery.countdown/dist/jquery.countdown.js') }}"></script>
<!-- Morphtext -->
<script src="{{ url_for('bower_components', path='/Morphist/dist/morphist.min.js') }}"></script>
<!-- begin document -->
<div class="fakeLoader"></div>
<script>
$.fakeLoader({'timeToHide':1200, 'spinner':'spinner4', 'bgColor': '#00003c'});
</script>
<header>
<div class="overlay"></div>
<video playsinline="playsinline" autoplay="autoplay" muted="muted" loop="loop">
<source src="{{ url_for('static', path='/assets/videos/gn19-short.mp4')}}" type="video/mp4">
</video>
<div class="container h-100">
<div class="d-flex h-100 text-center align-items-center">
<div class="w-100 text-white">
<img src="{{ url_for('static', path='/assets/images/wh_logo.png') }}" width="40%" style="padding-bottom: 40px;">
<div id="event-rotate">
<div>
<h1 class="display-3 hoxton-font">Grand National 2020</h1>
<span class="lead mb-0 hoxton-font display-5" id="gn-countdown"></span>
</div>
<div>
<h1 class="display-3 hoxton-font">Cheltenham 2020</h1>
<span class="lead mb-0 hoxton-font display-5" id="chelt-countdown"></span>
</div>
</div>
</div>
</div>
</div>
</header>
<div class="container-fluid">
<center>
<div class="row">
<div class="col-6">
<h2 class="hoxton-font" class="hoxton-font">Cheltenham Festival 2020</h2>
<hr style="width: 50%;">
<h4 class="hoxton-font">Day One 🐴 Tuesday 10th March</h4>
<h5 class="hoxton-font">Featuring the Unibet Champion Hurdle</h5>
<hr style="width: 50%;">
<h4 class="hoxton-font">Day Two 🐴 Wednesday 11th March</h4>
<h5 class="hoxton-font">Featuring the Betway Queen Mother Champion Chase</h5>
<hr style="width: 50%;">
<h4 class="hoxton-font">Day Three 🐴 Thursday 12th March</h4>
<h5 class="hoxton-font">Featuring the Ryanair Chase</h5>
<hr style="width: 50%;">
<h4 class="hoxton-font">Gold Cup Day 🏆 Friday 13th March</h4>
<h5 class="hoxton-font">Featuring the <i class="fas fa-wine-bottle" style="color: gold;"></i> Magners Cheltenham Gold Cup</h5>
</div>
<div class="col-6">
<h2 class="hoxton-font">Grand National 2020</h2>
<hr style="width: 50%;">
<h4 class="hoxton-font">Liverpool's Day 🐴 Thursday 2nd April</h4>
<h5 class="hoxton-font">Featuring the Betway Aintree Hurdle</h5>
<hr style="width: 50%;">
<h4 class="hoxton-font">Ladies Day at Aintree 🐴 Friday 3rd April</h4>
<h5 class="hoxton-font">Featuring the JLT Melling Steeple </h5>
<hr style="width: 50%;">
<h4 class="hoxton-font">Grand National Day 🏆 Saturday 4th April</h4>
<h5 class="hoxton-font">Featuring the Randox Health Grand National Steeple Chase</h5>
<hr style="width: 50%;">
<h4 class="hoxton-font"><i class="fas fa-horse"></i> 1st Favourite: Tiger Roll 🇮🇪</h4>
<h5 class="hoxton-font"><i class="fas fa-horse"></i> 2nd Favourite: Burrows Saint 🇫🇷</h4>
</div>
</div>
</center>
</div>
<!-- custom js -->
<script type="text/javascript" src="{{url_for('static', path='/js/gn.js')}}"></script>
</body>
</html>

View File

@@ -0,0 +1,8 @@
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7
RUN ["pip", "install", "aiofiles", "jinja2" ]
COPY ./app /app
COPY ./node_modules /node_modules
COPY ./bower_components /bower_components
COPY ./static /static

View File

@@ -25,7 +25,7 @@
<!-- bootstrap js -->
<script type="text/javascript" src="{{ url_for('static', path='/js/bootstrap.bundle.js') }}"></script>
<!-- font-awesome js -->
<script type="text/javascript" src="{{ url_for('static', path='/font-awesome/js/all.js')}}"></script>
<script type="text/javascript" src="{{ url_for('node_modules', path='/@fortawesome/fontawesome-free/js/all.js')}}"></script>
<!-- fakeLoader -->
<script type="text/javascript" src="{{ url_for('node_modules', path='/jq-fakeloader/js/fakeLoader.js') }}"></script>
<!-- final countdown -->
@@ -70,28 +70,28 @@
<h5 class="hoxton-font">Featuring the Unibet Champion Hurdle</h5>
<hr style="width: 50%;">
<h4 class="hoxton-font">Day Two 🐴 Wednesday 11th March</h4>
<h5 class="hoxton-font">Featuring The Betway Queen Mother Champion Chase</h5>
<h5 class="hoxton-font">Featuring the Betway Queen Mother Champion Chase</h5>
<hr style="width: 50%;">
<h4 class="hoxton-font">Day Three 🐴 Thursday 12th March</h4>
<h5 class="hoxton-font">Featuring The Ryanair Chase</h5>
<h5 class="hoxton-font">Featuring the Ryanair Chase</h5>
<hr style="width: 50%;">
<h4 class="hoxton-font">Gold Cup Day 🏆 - Friday 13th March</h4>
<h5 class="hoxton-font">Featuring The Magners Cheltenham Gold Cup</h5>
<h4 class="hoxton-font">Gold Cup Day 🏆 Friday 13th March</h4>
<h5 class="hoxton-font">Featuring the <i class="fas fa-wine-bottle" style="color: gold;"></i> Magners Cheltenham Gold Cup</h5>
</div>
<div class="col-6">
<h2 class="hoxton-font">Grand National 2020</h2>
<hr style="width: 50%;">
<h4 class="hoxton-font">Liverpool's Day 🐴 Thursday 2nd April</h4>
<h5 class="hoxton-font">Featuring The Betway Aintree Hurdle</h5>
<h5 class="hoxton-font">Featuring the Betway Aintree Hurdle</h5>
<hr style="width: 50%;">
<h4 class="hoxton-font">Ladies Day at Aintree 🐴 Friday 3rd April</h4>
<h5 class="hoxton-font">Featuring The JLT Melling Steeple </h5>
<h5 class="hoxton-font">Featuring the JLT Melling Steeple </h5>
<hr style="width: 50%;">
<h4 class="hoxton-font">Grand National Day 🏆 - Saturday 4th April</h4>
<h5 class="hoxton-font">Featuring The Randox Health Grand National Steeple Chase</h5>
<h4 class="hoxton-font">Grand National Day 🏆 Saturday 4th April</h4>
<h5 class="hoxton-font">Featuring the Randox Health Grand National Steeple Chase</h5>
<hr style="width: 50%;">
<h4 class="hoxton-font"><i class="fas fa-horse"></i> 1st Favourite: Tiger Roll 🇮🇪</h4>
<h4 class="hoxton-font"><i class="fas fa-horse"></i> 2nd Favourite: Burrows Saint 🇫🇷</h4>
<h5 class="hoxton-font"><i class="fas fa-horse"></i> 2nd Favourite: Burrows Saint 🇫🇷</h4>
</div>
</div>
</center>

View File

@@ -4,6 +4,11 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@fortawesome/fontawesome-free": {
"version": "5.12.1",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.12.1.tgz",
"integrity": "sha512-ZtjIIFplxncqxvogq148C3hBLQE+W3iJ8E4UvJ09zIJUgzwLcROsWwFDErVSXY2Plzao5J9KUYNHKHMEUYDMKw=="
},
"bootswatch": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/bootswatch/-/bootswatch-4.4.1.tgz",

View File

@@ -13,6 +13,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@fortawesome/fontawesome-free": "^5.12.1",
"bootswatch": "^4.4.1",
"jq-fakeloader": "^2.0.1"
}

View File

@@ -0,0 +1,17 @@
aiofiles==0.4.0
certifi==2019.11.28
chardet==3.0.4
click==7.0
fastapi==0.49.0
h11==0.9.0
httptools==0.1.1; sys_platform != "win32" and sys_platform != "cygwin" and platform_python_implementation != "PyPy"
idna==2.8
jinja2==2.11.1
markupsafe==1.1.1
pydantic==1.4
requests==2.22.0
starlette==0.12.9
urllib3==1.25.8
uvicorn==0.11.3
uvloop==0.14.0; sys_platform != "win32" and sys_platform != "cygwin" and platform_python_implementation != "PyPy"
websockets==8.1

View File

@@ -1,8 +1,8 @@
$('#gn-countdown').countdown('2020/04/04', function(event) {
$('#gn-countdown').countdown('2020/04/04 17:15', function(event) {
$(this).html(event.strftime('%D days %Hhrs %Mm %Ss'));
});
$('#chelt-countdown').countdown('2020/03/13', function(event) {
$('#chelt-countdown').countdown('2020/03/13 15:30', function(event) {
$(this).html(event.strftime('%D days %Hhrs %Mm %Ss'));
});
@@ -12,7 +12,7 @@ $("#event-rotate").Morphist({
// The exit animation type (Out). Refer to Animate.css for a list of available animations.
animateOut: "zoomOutRight",
// The delay between the changing of each object in milliseconds.
speed: 4000,
speed: 5000,
complete: function () {
// Called after the entrance animation is executed.
}