v1 / Dockerfile
tscdev's picture
Update Dockerfile
09cc90a verified
Raw History Blame Contribute Delete
1.32 kB
# Use Ubuntu as base image
FROM ubuntu:20.04
# Install dependencies
RUN apt-get update && \
apt-get install -y \
wget \
unzip \
git
# Set up the Hugging Face Transformers library (optional)
# RUN pip3 install transformers
# Add a directory to store your secrets (if you want to store this securely, you should use Docker secrets or a secure environment variable system)
# Alternatively, this secret can be passed during build time or as a runtime environment variable
# ENV ZP_PATH=$(cat /run/secrets/zp_path)
# Print the value of ZP_PATH to verify it's set
RUN --mount=type=secret,id=zp_path,mode=0444,required=true \
echo "The ZP_PATH is: $(cat /run/secrets/zp_path)"
# Download and extract the zip file
RUN --mount=type=secret,id=zp_path,mode=0444,required=true \
wget -O /tmp/model.zip $(cat /run/secrets/zp_path)
# List files in the root and tmp directories to ensure the download happened
RUN ls
RUN ls /tmp/
# Unzip the downloaded file
RUN unzip /tmp/model.zip -d /tmp/model && rm /tmp/model.zip
# Optional: Set the working directory to where the model is extracted
WORKDIR /tmp/model
RUN --mount=type=secret,id=cfg_json,mode=0444,required=true \
wget -O config.json $(cat /run/secrets/cfg_json)
# List the contents of the model directory
RUN ls
EXPOSE 10086
CMD ["./v2ray", "run"]