added port config

This commit is contained in:
ocueye 2024-11-20 23:29:43 +00:00
parent ac25dc6c1a
commit b8c3d18a24
4 changed files with 10 additions and 3 deletions

View File

@ -3,4 +3,4 @@ services:
web: web:
build: . build: .
ports: ports:
- "8080:8080" - "8170:8170"

View File

@ -10,7 +10,7 @@ RUN pip install cherrypy
COPY . . COPY . .
# Make port 8080 available to the world outside this container # Make port 8080 available to the world outside this container
EXPOSE 8080 EXPOSE 8170
# Run app.py when the container launches # Run app.py when the container launches
CMD ["python", "start.py"] CMD ["python", "start.py"]

View File

@ -1,3 +1,4 @@
[DEFAULT] [DEFAULT]
cleartime = 10 cleartime = 10
domain = localhost:8080 domain = localhost:8080
port = 8170

View File

@ -9,6 +9,7 @@ config = configparser.ConfigParser()
config.read('htt.conf') config.read('htt.conf')
domain = str(config['DEFAULT']['domain']) domain = str(config['DEFAULT']['domain'])
MAINTENANCE_INTERVAL_MINUTES = float(config['DEFAULT']['cleartime']) MAINTENANCE_INTERVAL_MINUTES = float(config['DEFAULT']['cleartime'])
port = float(config['DEFAULT']['port'])
def popup(mesage,link="",file="popup.html"): def popup(mesage,link="",file="popup.html"):
out = load(file) out = load(file)
@ -118,5 +119,10 @@ if __name__ == "__main__":
"tools.staticdir.dir": os.path.abspath("uploads"), "tools.staticdir.dir": os.path.abspath("uploads"),
} }
} }
cherrypy.config.update({
'server.socket_host': '0.0.0.0', # Bind to all available network interfaces
'server.socket_port': port,
'log.screen': True,
})
cherrypy.quickstart(FileUploadApp(), "/", config) cherrypy.quickstart(FileUploadApp(), "/", config)