added dockerfile and removed cxfreeze from web_monitor requirements due to it breaking the docker setup

This commit is contained in:
UpstreamData
2022-03-08 09:09:28 -07:00
parent 7e91fe12e7
commit 7ba8044564
7 changed files with 40 additions and 4 deletions

8
.dockerignore Normal file
View File

@@ -0,0 +1,8 @@
# Ignore VENV
venv
# Ignore builds
build
# Ignore github files
.github

13
Dockerfile Normal file
View File

@@ -0,0 +1,13 @@
FROM python:3.10-slim-buster
EXPOSE 80
WORKDIR /minerInterface-web_monitor
COPY tools/web_monitor/requirements.txt .
RUN pip install --no-cache-dir --upgrade -r requirements.txt
COPY . .
CMD ["uvicorn", "tools.web_monitor.app:app", "--host", "0.0.0.0", "--port", "80"]

Binary file not shown.

View File

@@ -1,5 +1,10 @@
from tools.web_monitor.app import app from tools.web_monitor.app import app
import uvicorn import uvicorn
def main():
uvicorn.run("app:app", host="0.0.0.0", port=80)
if __name__ == "__main__": if __name__ == "__main__":
uvicorn.run("app:app", host="127.0.0.1", port=11115) main()

View File

@@ -17,8 +17,8 @@ from tools.web_monitor.web_settings import get_current_settings, update_settings
app = FastAPI() app = FastAPI()
app.mount("/static", StaticFiles(directory="static"), name="static") app.mount("/static", StaticFiles(directory=os.path.join(os.path.dirname(__file__), "static")), name="static")
templates = Jinja2Templates(directory="templates") templates = Jinja2Templates(directory=os.path.join(os.path.dirname(__file__), "templates"))
@app.get("/") @app.get("/")
@@ -322,4 +322,4 @@ async def do_websocket_scan(websocket: WebSocket, network_ip: str):
if __name__ == "__main__": if __name__ == "__main__":
uvicorn.run("app:app", host="127.0.0.1", port=11115) uvicorn.run("app:app", host="0.0.0.0", port=80)

Binary file not shown.

10
web_monitor.py Normal file
View File

@@ -0,0 +1,10 @@
from tools.web_monitor.app import app
import uvicorn
def main():
uvicorn.run("web_monitor:app", host="0.0.0.0", port=80)
if __name__ == "__main__":
main()