File size: 911 Bytes
6573ca6
1100651
6573ca6
 
1100651
6573ca6
 
1100651
dda47cd
6573ca6
 
 
 
 
dda47cd
 
 
 
 
 
6573ca6
 
 
 
 
 
 
 
 
dda47cd
 
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 config.template.json /workspace/config.template.json
COPY entrypoint.sh /workspace/entrypoint.sh

# 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"]