Skip to content

Commit 5d891ef

Browse files
committed
fix webapp frozen problem
1 parent 547212e commit 5d891ef

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

docker/entrypoint.spec

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ a = Analysis(
88
['entrypoint.py'],
99
pathex=[],
1010
binaries=[],
11-
datas=[],
11+
datas=[
12+
('./nxbt/web/static','static'),
13+
('./nxbt/web/templates','templates')],
1214
hiddenimports=[
15+
'engineio.async_drivers.eventlet',
1316
'eventlet.hubs.epolls',
1417
'eventlet.hubs.kqueue',
1518
'eventlet.hubs.selects',
16-
'dns',
19+
'dns',
1720
'dns.dnssec',
1821
'dns.e164',
1922
'dns.namedict',

docker/gnu/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ WORKDIR /nxbt
44
COPY ./docker ./docker
55
COPY ./nxbt ./docker/nxbt
66
RUN apt update \
7-
&& apt install -y python3 python3-dev python3-pip python3-venv libssl-dev libdbus-glib-1-dev libdbus-1-dev \
7+
&& apt install -y python3 python3-dev python3-pip python3-venv libssl-dev libdbus-glib-1-dev libdbus-1-dev procps\
88
&& python3 -m venv /venv
99
ENV PATH="/venv/bin:$PATH"
1010
RUN pip install pyinstaller \

docker/musl/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ WORKDIR /nxbt
44
COPY ./docker ./docker
55
COPY ./nxbt ./docker/nxbt
66
RUN apk update \
7-
&& apk add python3 python3-dev py3-pip py3-virtualenv py3-dbus dbus-glib-dev make gcc g++ musl-dev libffi-dev openssl-dev \
7+
&& apk add python3 python3-dev py3-pip py3-virtualenv py3-dbus dbus-glib-dev make gcc g++ musl-dev libffi-dev openssl-dev procps\
88
&& python3 -m venv /venv
99
ENV PATH="/venv/bin:$PATH"
1010
RUN pip install pyinstaller \

nxbt/web/app.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
from flask_socketio import SocketIO, emit
1212
import eventlet
1313

14-
15-
app = Flask(__name__,
16-
static_url_path='',
17-
static_folder='static',)
1814
nxbt = Nxbt()
1915
if getattr(sys,'frozen',False):
2016
path=os.path.dirname(sys.executable)
17+
template_folder = os.path.join(sys._MEIPASS, 'templates')
18+
static_folder = os.path.join(sys._MEIPASS, 'static')
19+
app = Flask(__name__, static_url_path='', template_folder=template_folder, static_folder=static_folder)
2120
elif __file__:
2221
path=os.path.dirname(__file__)
22+
app = Flask(__name__, static_url_path='')
2323

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

164164

165165
if __name__ == "__main__":
166-
start_web_app()
166+
start_web_app()

0 commit comments

Comments
 (0)