feat(server): add Dockerfile, docker-compose, and systemd service templates for deployment

This commit is contained in:
shen
2026-10-27 03:11:36 -07:00
parent ef56202777
commit 9dba51c844
4 changed files with 50 additions and 2 deletions
+5 -2
View File
@@ -15,7 +15,10 @@ import datetime
from http.server import HTTPServer, BaseHTTPRequestHandler
from socketserver import ThreadingMixIn
DB_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'aerotrack.db')
DB_FILE = os.environ.get(
'AEROTRACK_DB',
os.path.join(os.path.dirname(os.path.abspath(__file__)), 'aerotrack.db')
)
def get_db():
conn = sqlite3.connect(DB_FILE, check_same_thread=False)
@@ -369,7 +372,7 @@ class SyncHandler(BaseHTTPRequestHandler):
self.wfile.write(encoded)
def main():
port = 8090
port = int(os.environ.get('PORT', 8090))
if len(sys.argv) > 1:
try:
port = int(sys.argv[1])