Skip to content

Commit

Permalink
fix webapp frozen problem
Browse files Browse the repository at this point in the history
  • Loading branch information
typenoob committed Oct 29, 2023
1 parent 547212e commit 5d891ef
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
7 changes: 5 additions & 2 deletions docker/entrypoint.spec
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ a = Analysis(
['entrypoint.py'],
pathex=[],
binaries=[],
datas=[],
datas=[
('./nxbt/web/static','static'),
('./nxbt/web/templates','templates')],
hiddenimports=[
'engineio.async_drivers.eventlet',
'eventlet.hubs.epolls',
'eventlet.hubs.kqueue',
'eventlet.hubs.selects',
'dns',
'dns',
'dns.dnssec',
'dns.e164',
'dns.namedict',
Expand Down
2 changes: 1 addition & 1 deletion docker/gnu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WORKDIR /nxbt
COPY ./docker ./docker
COPY ./nxbt ./docker/nxbt
RUN apt update \
&& apt install -y python3 python3-dev python3-pip python3-venv libssl-dev libdbus-glib-1-dev libdbus-1-dev \
&& apt install -y python3 python3-dev python3-pip python3-venv libssl-dev libdbus-glib-1-dev libdbus-1-dev procps\
&& python3 -m venv /venv
ENV PATH="/venv/bin:$PATH"
RUN pip install pyinstaller \
Expand Down
2 changes: 1 addition & 1 deletion docker/musl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WORKDIR /nxbt
COPY ./docker ./docker
COPY ./nxbt ./docker/nxbt
RUN apk update \
&& apk add python3 python3-dev py3-pip py3-virtualenv py3-dbus dbus-glib-dev make gcc g++ musl-dev libffi-dev openssl-dev \
&& apk add python3 python3-dev py3-pip py3-virtualenv py3-dbus dbus-glib-dev make gcc g++ musl-dev libffi-dev openssl-dev procps\
&& python3 -m venv /venv
ENV PATH="/venv/bin:$PATH"
RUN pip install pyinstaller \
Expand Down
10 changes: 5 additions & 5 deletions nxbt/web/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
from flask_socketio import SocketIO, emit
import eventlet


app = Flask(__name__,
static_url_path='',
static_folder='static',)
nxbt = Nxbt()
if getattr(sys,'frozen',False):
path=os.path.dirname(sys.executable)
template_folder = os.path.join(sys._MEIPASS, 'templates')
static_folder = os.path.join(sys._MEIPASS, 'static')
app = Flask(__name__, static_url_path='', template_folder=template_folder, static_folder=static_folder)
elif __file__:
path=os.path.dirname(__file__)
app = Flask(__name__, static_url_path='')

# Configuring/retrieving secret key
secrets_path = os.path.join(
Expand Down Expand Up @@ -163,4 +163,4 @@ def start_web_app(ip='0.0.0.0', port=8000, usessl=False, cert_path=None):


if __name__ == "__main__":
start_web_app()
start_web_app()

0 comments on commit 5d891ef

Please sign in to comment.