fix: Docker python version and fix reporting missing requirements
All checks were successful
Build Docker / Build Image (push) Successful in 2m58s
All checks were successful
Build Docker / Build Image (push) Successful in 2m58s
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
FROM --platform=$BUILDPLATFORM python:3.10-alpine AS builder
|
FROM --platform=$BUILDPLATFORM python:3.13-alpine AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
RUN apk add git openssl curl
|
||||||
COPY requirements.txt /app
|
COPY requirements.txt /app
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||||
pip3 install -r requirements.txt
|
pip3 install -r requirements.txt
|
||||||
@@ -10,9 +10,8 @@ COPY . /app
|
|||||||
|
|
||||||
# Add mount point for data volume
|
# Add mount point for data volume
|
||||||
# VOLUME /data
|
# VOLUME /data
|
||||||
RUN apk add git openssl curl
|
|
||||||
|
|
||||||
ENTRYPOINT ["python3"]
|
ENTRYPOINT ["python3"]
|
||||||
CMD ["server.py"]
|
CMD ["server.py"]
|
||||||
|
|
||||||
FROM builder as dev-envs
|
FROM builder AS dev-envs
|
||||||
|
|||||||
46
account.py
46
account.py
@@ -1784,25 +1784,34 @@ def checkPreRequisites() -> dict[str, bool]:
|
|||||||
"git": False,
|
"git": False,
|
||||||
"hsd": False
|
"hsd": False
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Check if node is installed and get version
|
||||||
|
nodeSubprocess = subprocess.run(["node", "-v"], capture_output=True, text=True)
|
||||||
|
if nodeSubprocess.returncode == 0:
|
||||||
|
major_version = int(nodeSubprocess.stdout.strip().lstrip('v').split('.')[0])
|
||||||
|
if major_version >= HSD_CONFIG.get("minNodeVersion", 20):
|
||||||
|
prerequisites["node"] = True
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
|
||||||
# Check if node is installed and get version
|
try:
|
||||||
nodeSubprocess = subprocess.run(["node", "-v"], capture_output=True, text=True)
|
# Check if npm is installed
|
||||||
if nodeSubprocess.returncode == 0:
|
npmSubprocess = subprocess.run(["npm", "-v"], capture_output=True, text=True)
|
||||||
major_version = int(nodeSubprocess.stdout.strip().lstrip('v').split('.')[0])
|
if npmSubprocess.returncode == 0:
|
||||||
if major_version >= HSD_CONFIG.get("minNodeVersion", 20):
|
major_version = int(npmSubprocess.stdout.strip().split('.')[0])
|
||||||
prerequisites["node"] = True
|
if major_version >= HSD_CONFIG.get("minNPMVersion", 8):
|
||||||
|
prerequisites["npm"] = True
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
|
||||||
# Check if npm is installed
|
try:
|
||||||
npmSubprocess = subprocess.run(["npm", "-v"], capture_output=True, text=True)
|
# Check if git is installed
|
||||||
if npmSubprocess.returncode == 0:
|
gitSubprocess = subprocess.run(["git", "-v"], capture_output=True, text=True)
|
||||||
major_version = int(npmSubprocess.stdout.strip().split('.')[0])
|
if gitSubprocess.returncode == 0:
|
||||||
if major_version >= HSD_CONFIG.get("minNPMVersion", 8):
|
prerequisites["git"] = True
|
||||||
prerequisites["npm"] = True
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
# Check if git is installed
|
|
||||||
gitSubprocess = subprocess.run(["git", "-v"], capture_output=True, text=True)
|
|
||||||
if gitSubprocess.returncode == 0:
|
|
||||||
prerequisites["git"] = True
|
|
||||||
|
|
||||||
# Check if hsd is installed
|
# Check if hsd is installed
|
||||||
if os.path.exists("./hsd/bin/hsd"):
|
if os.path.exists("./hsd/bin/hsd"):
|
||||||
@@ -1832,7 +1841,7 @@ def hsdInit():
|
|||||||
for key, value in prerequisites.items():
|
for key, value in prerequisites.items():
|
||||||
if not value:
|
if not value:
|
||||||
print(f" - {key} is missing or does not meet the version requirement.")
|
print(f" - {key} is missing or does not meet the version requirement.")
|
||||||
exit(1)
|
exit(1)
|
||||||
return
|
return
|
||||||
|
|
||||||
# Check if hsd is installed
|
# Check if hsd is installed
|
||||||
@@ -1958,7 +1967,6 @@ def hsdRestart():
|
|||||||
hsdStart()
|
hsdStart()
|
||||||
|
|
||||||
|
|
||||||
checkPreRequisites()
|
|
||||||
hsdInit()
|
hsdInit()
|
||||||
hsdStart()
|
hsdStart()
|
||||||
# endregion
|
# endregion
|
||||||
Reference in New Issue
Block a user