vpn integration

This commit is contained in:
2026-04-11 21:51:30 +02:00
parent 4671e5da63
commit c4d27e9842
26 changed files with 2566 additions and 899 deletions
+81
View File
@@ -0,0 +1,81 @@
FROM python:3.14-slim
####################################################################
# ARG and ENV
####################################################################
ARG USER_ID=1000
ARG GROUP_ID=1000
ARG USER_NAME=oxpanel
ARG GROUP_NAME=oxpanel
ARG NODE_VERSION=24
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
UV_COMPILE_BYTECODE=1 \
UV_LINK_MODE=copy \
USER_DIR="/oxpanel" \
APP_DIR="/oxpanel/app"
####################################################################
# System dependencies
####################################################################
#RUN apt update && apt install -y gcc graphviz graphviz-dev pkg-config libpq-dev g++ supervisor
RUN apt-get update && apt-get install -y \
ca-certificates \
curl \
gnupg \
inotify-tools \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
| gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_VERSION}.x nodistro main" \
> /etc/apt/sources.list.d/nodesource.list \
&& apt-get update \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# install yarn
RUN npm install -g yarn
####################################################################
# Setup app dependencies
####################################################################
RUN --mount=from=ghcr.io/astral-sh/uv,source=/uv,target=/bin/uv \
--mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv export --locked --format requirements-txt | uv pip install --system -r -
####################################################################
# User and Group
####################################################################
RUN mkdir -p ${USER_DIR} \
&& groupadd --gid ${GROUP_ID} ${USER_NAME} \
&& useradd -m -d ${USER_DIR} -u ${USER_ID} -g ${GROUP_ID} -o -s /bin/bash ${USER_NAME} \
&& chown ${USER_ID}:${GROUP_ID} ${USER_DIR} -R
USER ${USER_NAME}
WORKDIR ${APP_DIR}
####################################################################
# Runtime
####################################################################
# setup node dependencies
COPY --chown=${USER_ID}:${GROUP_ID} ./app/frontend/package.json ./app/frontend/yarn.lock ${APP_DIR}/frontend/
RUN cd ${APP_DIR}/frontend \
&& yarn install \
&& cd -
#COPY --chown=${USER_ID}:${GROUP_ID} ./app ${APP_DIR}
#RUN mkdir -p ~/.ipython/profile_default/
#RUN echo "c.InteractiveShellApp.extensions = ['autoreload']\nc.InteractiveShellApp.exec_lines = ['%autoreload 2']" > ~/.ipython/profile_default/ipython_config.py
EXPOSE 8000
#CMD bash -c "sleep 2 && python manage.py collectstatic --noinput && python manage.py migrate && uvicorn oxpanel.asgi:application --workers 5 --host 0.0.0.0 --port 8000 --lifespan off --loop asyncio --ws websockets"
CMD ["python", "run_uvicorn.py"]