Prepare WebSSH for self-hosted deployment
This commit is contained in:
+13
-10
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user