Spaces:
Paused
Paused
Manus Agent commited on
Commit ·
2d9a2cd
1
Parent(s): 878b007
Add Dockerfile and entrypoint script for Coder deployment (token attempt)
Browse filesFiles changed (2)
- DockerfileAdded+25
- entrypoint.shAdded+21
12345678910111213141516171819202122232425FROM ghcr.io/coder/coder:latest
# Copy the custom entrypoint scriptCOPY entrypoint.sh /usr/local/bin/entrypoint.sh
# Make it executableRUN chmod +x /usr/local/bin/entrypoint.sh
# Set the user (coder images run as `coder` user by default, UID 1000)USER coder
# Set the working directory for Coder (optional, as Coder might set its own)WORKDIR /home/coder
# Expose the port Coder will listen on (Hugging Face Spaces expects 7860)EXPOSE 7860
# Set the entrypoint to our custom scriptENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
# Default command to start Coder server, listening on the correct port# CODER_ACCESS_URL will be set by entrypoint.sh# CODER_PG_CONNECTION_URL should be set as a secret in Hugging Face Space settings# CODER_DATA_DIR should be set as an environment variable (e.g., /data/coder-data) in Hugging Face Space settings for persistenceCMD ["coder", "server", "--http-listen-addr", "0.0.0.0:7860"]123456789101112131415161718192021#!/bin/shset -e
# Set CODER_ACCESS_URL from SPACE_HOSTif [ -n "$SPACE_HOST" ]; then export CODER_ACCESS_URL="https://${SPACE_HOST}" echo "CODER_ACCESS_URL set to: $CODER_ACCESS_URL"else echo "Warning: SPACE_HOST environment variable not set. CODER_ACCESS_URL may be incorrect."fi
# Create the data directory if it doesn't existif [ -n "$CODER_DATA_DIR" ]; then echo "Ensuring CODER_DATA_DIR ($CODER_DATA_DIR) exists..." mkdir -p "$CODER_DATA_DIR" echo "$CODER_DATA_DIR ensured."fi
echo "Starting Coder server..."# Execute the original CMD (coder server)exec "$@"DockerfileAdded+25
entrypoint.shAdded+21