-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (28 loc) · 1.04 KB
/
Copy pathDockerfile
File metadata and controls
36 lines (28 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM python:3.12-slim
ARG XRAY_VERSION=26.3.27
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
XRAY_BIN=/usr/local/bin/xray \
XRAY_READY_FILE=/tmp/xray-ready
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl unzip \
&& arch="$(dpkg --print-architecture)" \
&& case "$arch" in \
amd64) xray_arch="64" ;; \
arm64) xray_arch="arm64-v8a" ;; \
*) echo "Unsupported architecture: $arch" >&2; exit 1 ;; \
esac \
&& curl -fsSL \
"https://github.com/XTLS/Xray-core/releases/download/v${XRAY_VERSION}/Xray-linux-${xray_arch}.zip" \
-o /tmp/xray.zip \
&& mkdir -p /tmp/xray-unpack \
&& unzip -q /tmp/xray.zip -d /tmp/xray-unpack \
&& install -m 0755 /tmp/xray-unpack/xray /usr/local/bin/xray \
&& xray version \
&& rm -rf /var/lib/apt/lists/* /tmp/xray.zip /tmp/xray-unpack
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8000
ENTRYPOINT ["python", "scripts/supervisor.py"]