Spaces:
Paused
Paused
Manus Agent commited on
Commit ·
385f70a
1
Parent(s): ed0a9e1
Update Dockerfile to use CODER_HTTP_ADDRESS env var and simplify CMD
Browse files13 unmodified lines14151617181920212223242526272829303132333435362237383940264113 unmodified linesWORKDIR /home/coder
# Expose the port Coder will listen on (Hugging Face Spaces expects 7860)# Coder server by default listens on 0.0.0.0:3000 if CODER_HTTP_ADDRESS is not set.# Hugging Face Spaces will map its internal 7860 to the container's exposed port.# We will rely on Hugging Face to map its required 7860 to Coder's default or configured port.# For Hugging Face, the application in the container *must* listen on port 7860.# So, we need to ensure Coder listens on 7860. The docs suggest CODER_HTTP_ADDRESS env var.# Let's try setting CODER_HTTP_ADDRESS in entrypoint.sh or as an env var in Dockerfile if possible,# or see if coder server has a flag for this in newer versions.# For now, let's assume Coder will pick up a port or we configure it via ENV.# The previous CMD was ["coder", "server", "--http-listen-addr", "0.0.0.0:7860"]# The new Coder versions don't use --http-listen-addr.# The documentation implies `coder server` alone should work, and it might listen on 0.0.0.0:3000 by default.# Hugging Face Spaces requires the app to listen on 0.0.0.0:7860.# We will set CODER_HTTP_ADDRESS="0.0.0.0:7860" as an environment variable in the Dockerfile.
ENV CODER_HTTP_ADDRESS="0.0.0.0: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# Default command to start Coder server.# 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"]CMD ["coder", "server"]Dockerfile+17-2