feat: Add WSGI server and build config for Clever Cloud

master
Robbert Schep 2025-07-07 13:32:30 +02:00
parent eda2645bd0
commit 12e7e763ac
3 changed files with 34 additions and 1 deletions

View File

@ -1,5 +1,10 @@
mkdocs-material
# For building the site
mkdocs
mkdocs-material
mkdocs-awesome-pages-plugin
mkdocs-git-revision-date-plugin
requests
# For serving the site via WSGI on Clever Cloud
gunicorn
whitenoise

8
server.py Normal file
View File

@ -0,0 +1,8 @@
# server.py
from whitenoise import WhiteNoise
def not_found(environ, start_response):
start_response('404 NOT FOUND', [('Content-Type', 'text/plain')])
return [b'Not Found']
application = WhiteNoise(not_found, root='site/', index_file=True)

20
setup.py Normal file
View File

@ -0,0 +1,20 @@
# setup.py
import os
from setuptools import setup
from setuptools.command.install import install
class BuildMkDocsCommand(install):
"""Custom command to build the MkDocs site."""
def run(self):
print("--> Running custom build command: mkdocs build")
os.system("mkdocs build")
print("--> MkDocs build complete.")
setup(
name='smartup-zero-timeline',
version='1.0.0',
description='A wrapper to build and serve the MkDocs site on Clever Cloud.',
cmdclass={
'build_mkdocs': BuildMkDocsCommand,
}
)