testvsc2 / Dockerfile.bak
2
chore: 更新Docker配置并添加部署脚本
3ab24da
Raw
History Blame Contribute Delete
1.02 kB
FROM codercom/code-server:latest
# Environment variables that will be used by entrypoint or code-server
# PASSWORD will be injected by Hugging Face Secrets
# PORT is often set by Hugging Face Spaces (defaulting to 7860 if not set)
ENV PORT=${PORT:-7860}
ENV DEFAULT_WORKSPACE=/home/coder/project
ENV USER_DATA_DIR=/home/coder/.local/share/code-server
ENV EXTENSIONS_DIR=${USER_DATA_DIR}/extensions
ENV CONFIG_DIR=/home/coder/.config/code-server
# Copy the entrypoint script to a location accessible by the 'coder' user
# The base image runs as 'coder' user.
COPY --chown=coder:coder entrypoint.sh /home/coder/entrypoint.sh
RUN chmod +x /home/coder/entrypoint.sh
# Expose the port code-server will listen on
EXPOSE ${PORT}
# Set the entrypoint. The script will handle starting code-server.
ENTRYPOINT ["/home/coder/entrypoint.sh"]
# Default argument to the entrypoint, which can be the workspace to open.
# The entrypoint script currently hardcodes this, but this is a common pattern.
CMD ["/home/coder/project"]