opencode-api / Dockerfile
kazukaraya12's picture
Create Dockerfile
521aec0 verified
FROM python:3.10-slim
# Install system dependencies, Git, and Node.js
RUN apt-get update && apt-get install -y curl git npm
# Install OpenCode CLI globally
RUN npm install -g opencode-ai
# Set up the working directory
WORKDIR /app
# Install Python API dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the API logic into the container
COPY main.py .
# Expose port 7860 (Hugging Face standard)
EXPOSE 7860
# Start the FastAPI server
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]