Spaces:
No application file
No application file
File size: 799 Bytes
bb37e96 | 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 | 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 (Open-source version)
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 your local configuration file into the container
COPY config.json /workspace/config.json
# 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
# Execute Xray using the specified configuration
CMD ["./xray", "run", "-c", "/workspace/config.json"] |