huggingface-testing / Dockerfile
themtj's picture
Create Dockerfile
bb37e96 verified
Raw
History Blame Contribute Delete
799 Bytes
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"]