added dockerfile and removed cxfreeze from web_monitor requirements due to it breaking the docker setup
This commit is contained in:
8
.dockerignore
Normal file
8
.dockerignore
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Ignore VENV
|
||||||
|
venv
|
||||||
|
|
||||||
|
# Ignore builds
|
||||||
|
build
|
||||||
|
|
||||||
|
# Ignore github files
|
||||||
|
.github
|
||||||
13
Dockerfile
Normal file
13
Dockerfile
Normal 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"]
|
||||||
BIN
requirements.txt
BIN
requirements.txt
Binary file not shown.
@@ -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()
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
BIN
tools/web_monitor/requirements.txt
Normal file
BIN
tools/web_monitor/requirements.txt
Normal file
Binary file not shown.
10
web_monitor.py
Normal file
10
web_monitor.py
Normal 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()
|
||||||
Reference in New Issue
Block a user