Prepare WebSSH for self-hosted deployment

This commit is contained in:
jocayn
2026-06-13 12:11:36 +08:00
parent aaac2afe2a
commit 845c3dece3
20 changed files with 1628 additions and 183 deletions
+13 -10
View File
@@ -1,18 +1,21 @@
FROM python:3-alpine
FROM python:3.12-slim
LABEL maintainer='<author>'
LABEL version='0.0.0-dev.0-build.0'
ADD . /code
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /code
RUN \
apk add --no-cache libc-dev libffi-dev gcc && \
pip install -r requirements.txt --no-cache-dir && \
apk del gcc libc-dev libffi-dev && \
addgroup webssh && \
adduser -Ss /bin/false -g webssh webssh && \
chown -R webssh:webssh /code
COPY requirements.txt /code/
RUN pip install -r requirements.txt --no-cache-dir
COPY . /code
RUN useradd --system --create-home --shell /usr/sbin/nologin webssh && \
mkdir -p /data && \
chown -R webssh:webssh /code /data
EXPOSE 8888/tcp
USER webssh
CMD ["python", "run.py"]
CMD ["python", "run.py", "--address=0.0.0.0", "--port=8888", "--data-dir=/data"]