-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1390 from v-kamerdinerov/small-image-less-cve
Bump python, small image size, close python CVE, add new flag UVICORN_SSL_CA_TYPE
- Loading branch information
Showing
10 changed files
with
148 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
**/node_modules | ||
__pycache__ | ||
*.log | ||
*.pyc | ||
*.pyo | ||
*.pyd | ||
*.pyo | ||
.env* | ||
__pycache__ | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
*.log | ||
v2ray-core | ||
venv | ||
xray-core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,35 @@ | ||
FROM python:3.10-slim | ||
ARG PYTHON_VERSION=3.12 | ||
|
||
ENV PYTHONUNBUFFERED 1 | ||
FROM python:$PYTHON_VERSION-slim AS build | ||
|
||
ENV PYTHONUNBUFFERED=1 | ||
|
||
WORKDIR /code | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y curl unzip gcc python3-dev \ | ||
&& apt-get install -y --no-install-recommends build-essential curl unzip gcc python3-dev libpq-dev \ | ||
&& curl -L https://github.com/Gozargah/Marzban-scripts/raw/master/install_latest_xray.sh | bash \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN bash -c "$(curl -L https://github.com/Gozargah/Marzban-scripts/raw/master/install_latest_xray.sh)" | ||
|
||
COPY ./requirements.txt /code/ | ||
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | ||
RUN python3 -m pip install --upgrade pip setuptools \ | ||
&& pip install --no-cache-dir --upgrade -r /code/requirements.txt | ||
|
||
COPY . /code | ||
FROM python:$PYTHON_VERSION-slim | ||
|
||
ENV PYTHON_LIB_PATH=/usr/local/lib/python${PYTHON_VERSION%.*}/site-packages | ||
WORKDIR /code | ||
|
||
RUN rm -rf $PYTHON_LIB_PATH/* | ||
|
||
RUN apt-get remove -y curl unzip gcc python3-dev | ||
COPY --from=build $PYTHON_LIB_PATH $PYTHON_LIB_PATH | ||
COPY --from=build /usr/local/bin /usr/local/bin | ||
COPY --from=build /usr/local/share/xray /usr/local/share/xray | ||
|
||
COPY . /code | ||
|
||
RUN ln -s /code/marzban-cli.py /usr/bin/marzban-cli \ | ||
&& chmod +x /usr/bin/marzban-cli \ | ||
&& marzban-cli completion install --shell bash | ||
|
||
CMD ["bash", "-c", "alembic upgrade head; python main.py"] | ||
CMD ["bash", "-c", "alembic upgrade head; python main.py"] |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.