Initial commit: Erika CV site with Nomad deployment
Some checks failed
Build and Deploy Erika CV / build-and-deploy (push) Failing after 10s
Some checks failed
Build and Deploy Erika CV / build-and-deploy (push) Failing after 10s
This commit is contained in:
25
app.py
Normal file
25
app.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from flask import Flask, render_template, jsonify
|
||||
from datetime import datetime, timezone
|
||||
import os
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
BUILD_VERSION = os.getenv('BUILD_VERSION', 'unknown')
|
||||
GIT_COMMIT = os.getenv('GIT_COMMIT', 'unknown')
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
return render_template('index.html')
|
||||
|
||||
@app.route('/health')
|
||||
def health():
|
||||
return jsonify({
|
||||
'status': 'healthy',
|
||||
'timestamp': datetime.now(timezone.utc).isoformat(),
|
||||
'version': BUILD_VERSION,
|
||||
'commit': GIT_COMMIT[:7] if GIT_COMMIT != 'unknown' else 'unknown'
|
||||
})
|
||||
|
||||
if __name__ == '__main__':
|
||||
port = int(os.getenv('PORT', 5000))
|
||||
app.run(host='0.0.0.0', port=port)
|
||||
Reference in New Issue
Block a user