updating docker deployment
This commit is contained in:
1
grandnational-dashboard/.gitignore
vendored
1
grandnational-dashboard/.gitignore
vendored
@@ -138,3 +138,4 @@ dmypy.json
|
|||||||
*node_modules
|
*node_modules
|
||||||
*font-awesome
|
*font-awesome
|
||||||
*.mp4
|
*.mp4
|
||||||
|
*docker-image
|
||||||
|
|||||||
8
grandnational-dashboard/Dockerfile
Normal file
8
grandnational-dashboard/Dockerfile
Normal 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
BIN
grandnational-dashboard/app/.DS_Store
vendored
Normal file
Binary file not shown.
1
grandnational-dashboard/app/__init__.py
Normal file
1
grandnational-dashboard/app/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
__version__ = '0.1.0'
|
||||||
32
grandnational-dashboard/app/main.py
Normal file
32
grandnational-dashboard/app/main.py
Normal 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)
|
||||||
102
grandnational-dashboard/app/templates/index.html
Normal file
102
grandnational-dashboard/app/templates/index.html
Normal 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>
|
||||||
8
grandnational-dashboard/dashboard.Dockerfile
Normal file
8
grandnational-dashboard/dashboard.Dockerfile
Normal 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
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
<!-- bootstrap js -->
|
<!-- bootstrap js -->
|
||||||
<script type="text/javascript" src="{{ url_for('static', path='/js/bootstrap.bundle.js') }}"></script>
|
<script type="text/javascript" src="{{ url_for('static', path='/js/bootstrap.bundle.js') }}"></script>
|
||||||
<!-- font-awesome js -->
|
<!-- 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 -->
|
<!-- fakeLoader -->
|
||||||
<script type="text/javascript" src="{{ url_for('node_modules', path='/jq-fakeloader/js/fakeLoader.js') }}"></script>
|
<script type="text/javascript" src="{{ url_for('node_modules', path='/jq-fakeloader/js/fakeLoader.js') }}"></script>
|
||||||
<!-- final countdown -->
|
<!-- final countdown -->
|
||||||
@@ -70,28 +70,28 @@
|
|||||||
<h5 class="hoxton-font">Featuring the Unibet Champion Hurdle</h5>
|
<h5 class="hoxton-font">Featuring the Unibet Champion Hurdle</h5>
|
||||||
<hr style="width: 50%;">
|
<hr style="width: 50%;">
|
||||||
<h4 class="hoxton-font">Day Two 🐴 Wednesday 11th March</h4>
|
<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%;">
|
<hr style="width: 50%;">
|
||||||
<h4 class="hoxton-font">Day Three 🐴 Thursday 12th March</h4>
|
<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%;">
|
<hr style="width: 50%;">
|
||||||
<h4 class="hoxton-font">Gold Cup Day 🏆 - Friday 13th March</h4>
|
<h4 class="hoxton-font">Gold Cup Day 🏆 Friday 13th March</h4>
|
||||||
<h5 class="hoxton-font">Featuring The Magners Cheltenham Gold Cup</h5>
|
<h5 class="hoxton-font">Featuring the <i class="fas fa-wine-bottle" style="color: gold;"></i> Magners Cheltenham Gold Cup</h5>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<h2 class="hoxton-font">Grand National 2020</h2>
|
<h2 class="hoxton-font">Grand National 2020</h2>
|
||||||
<hr style="width: 50%;">
|
<hr style="width: 50%;">
|
||||||
<h4 class="hoxton-font">Liverpool's Day 🐴 Thursday 2nd April</h4>
|
<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%;">
|
<hr style="width: 50%;">
|
||||||
<h4 class="hoxton-font">Ladies Day at Aintree 🐴 Friday 3rd April</h4>
|
<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%;">
|
<hr style="width: 50%;">
|
||||||
<h4 class="hoxton-font">Grand National Day 🏆 - Saturday 4th April</h4>
|
<h4 class="hoxton-font">Grand National Day 🏆 Saturday 4th April</h4>
|
||||||
<h5 class="hoxton-font">Featuring The Randox Health Grand National Steeple Chase</h5>
|
<h5 class="hoxton-font">Featuring the Randox Health Grand National Steeple Chase</h5>
|
||||||
<hr style="width: 50%;">
|
<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> 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>
|
||||||
</div>
|
</div>
|
||||||
</center>
|
</center>
|
||||||
|
|||||||
5
grandnational-dashboard/package-lock.json
generated
5
grandnational-dashboard/package-lock.json
generated
@@ -4,6 +4,11 @@
|
|||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"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": {
|
"bootswatch": {
|
||||||
"version": "4.4.1",
|
"version": "4.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/bootswatch/-/bootswatch-4.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/bootswatch/-/bootswatch-4.4.1.tgz",
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@fortawesome/fontawesome-free": "^5.12.1",
|
||||||
"bootswatch": "^4.4.1",
|
"bootswatch": "^4.4.1",
|
||||||
"jq-fakeloader": "^2.0.1"
|
"jq-fakeloader": "^2.0.1"
|
||||||
}
|
}
|
||||||
|
|||||||
17
grandnational-dashboard/requirements.txt
Normal file
17
grandnational-dashboard/requirements.txt
Normal 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
|
||||||
@@ -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'));
|
$(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'));
|
$(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.
|
// The exit animation type (Out). Refer to Animate.css for a list of available animations.
|
||||||
animateOut: "zoomOutRight",
|
animateOut: "zoomOutRight",
|
||||||
// The delay between the changing of each object in milliseconds.
|
// The delay between the changing of each object in milliseconds.
|
||||||
speed: 4000,
|
speed: 5000,
|
||||||
complete: function () {
|
complete: function () {
|
||||||
// Called after the entrance animation is executed.
|
// Called after the entrance animation is executed.
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user