File size: 942 Bytes
2bbde2c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b83b428
589e5f1
2bbde2c
 
b83b428
2bbde2c
 
 
 
 
 
 
 
 
 
b83b428
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
FROM alpine:latest

# Install necessary dependencies
RUN apk add --no-cache tzdata ca-certificates wget unzip

# Set up a working directory
WORKDIR /workspace

# Download and install Xray Core
RUN wget https://github.com/XTLS/Xray-core/releases/latest/download/Xray-linux-64.zip && \

    unzip Xray-linux-64.zip && \
    rm Xray-linux-64.zip && \
    chmod +x xray

# Copy the template config and the startup script
COPY entrypoint.sh /workspace/entrypoint.sh 
COPY config.template.json /workspace/config.template.json

# Make the startup script executable
RUN chmod +x /workspace/entrypoint.sh

# Create a non-root user (Hugging Face standard security practice)
RUN adduser -D -u 1000 appuser && \

    chown -R appuser:appuser /workspace
USER 1000

# Expose the mandatory Hugging Face web port
EXPOSE 7860

# Run the entrypoint script on startup instead of calling Xray directly
CMD ["/workspace/entrypoint.sh"]