commit
4769c6979a
|
|
@ -23,4 +23,6 @@ COPY agents/ agents/
|
||||||
COPY pyserver/ pyserver/
|
COPY pyserver/ pyserver/
|
||||||
COPY server.py .
|
COPY server.py .
|
||||||
|
|
||||||
|
ENV CONTAINERIZED=1
|
||||||
|
|
||||||
CMD ["python", "server.py"]
|
CMD ["python", "server.py"]
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
from flask import Flask, jsonify, request
|
from flask import Flask, jsonify, request
|
||||||
from agents import Agent
|
from agents import Agent
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
@ -24,6 +26,7 @@ class PyServer:
|
||||||
:param import_name: Flask application import name
|
:param import_name: Flask application import name
|
||||||
:type import_name: str
|
:type import_name: str
|
||||||
"""
|
"""
|
||||||
|
self.containerized : bool = bool(int(os.environ.get("CONTAINERIZED", "0")))
|
||||||
self.agent = agent
|
self.agent = agent
|
||||||
self.app = Flask(import_name)
|
self.app = Flask(import_name)
|
||||||
|
|
||||||
|
|
@ -49,6 +52,7 @@ class PyServer:
|
||||||
|
|
||||||
d = { **self.agent.profile, **d }
|
d = { **self.agent.profile, **d }
|
||||||
|
|
||||||
|
d["me.noordstar.peanuts.containerized"] = self.containerized
|
||||||
d["games"] = {}
|
d["games"] = {}
|
||||||
for game, (profile, _) in self.agent.registered_games.items():
|
for game, (profile, _) in self.agent.registered_games.items():
|
||||||
d["games"][game] = profile
|
d["games"][game] = profile
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue