Build
socaity build turns your project into a Docker image. APIPod scans the code for framework hints, picks a base image from the catalog, prompts you to accept the choice, generates a Dockerfile, and (optionally) runs docker build.
socaity scan inspects the project and writes apipod-deploy/apipod.json. socaity build calls the scanner if needed, then renders the Dockerfile. Run them separately when you want to edit the scan output before building. The scanner walks your project and writes a single config file at apipod-deploy/apipod.json. It records the entrypoint (defaults to main.py), the Python version (defaults to 3.10), framework signals (PyTorch, TensorFlow, ONNX, transformers, diffusers, CUDA), required system packages, model files on disk, and whether a .env file is present.
socaity scan
# writes apipod-deploy/apipod.json Run from the project root. socaity build reuses the existing apipod-deploy/apipod.json if you already scanned, otherwise it scans first. It then proposes a base image, asks you to confirm, writes apipod-deploy/Dockerfile, and offers to invoke docker build -t apipod-<title>.
socaity build
# or target a specific entrypoint:
socaity build ./service.pyScanning project... torch detected, python_version=3.10
Recommended base image: runpod/pytorch:2.4.0-py3.11-cuda12.4.1-devel-ubuntu22.04
Is this correct? [Y/n] y
Generating Dockerfile at apipod-deploy/Dockerfile...
Build the application now using docker? (Tag: apipod-my-service) [Y/n] y
Running: docker build -t apipod-my-service -f apipod-deploy/Dockerfile .
...
Successfully built sha256:a1b2c3d4
Tagged as: apipod-my-service:latest The CLI takes an optional FILE argument on socaity build to override the detected entrypoint, plus deployment flags such as --provider and --compute.
| Flag | Default | Description |
|---|---|---|
[FILE] | main.py | Optional Python entrypoint. Overrides the detected file. |
--orchestrator | local | local or socaity. Baked into the image as APIPOD_ORCHESTRATOR. |
--compute | dedicated | dedicated or serverless. Baked as APIPOD_COMPUTE. |
--provider | localhost | auto, localhost, runpod, scaleway, azure. Baked as APIPOD_PROVIDER. scaleway and azure raise NotImplementedError today. |
--region | None | Accepted and written to the deploy config, but not yet applied. Region is platform-selected today (roadmap). |
scaleway and azure are listed as provider values but raise NotImplementedError today. Use localhost or runpod. The catalog at apipod/deploy/docker_images.txt holds 23 base images: python:3.7-slim through python:3.14-slim and 14 runpod/pytorch variants spanning CUDA 12.1, 12.8, 12.9, 13.0 and PyTorch 2.60, 2.71, 2.80 on Ubuntu 22.04 or 24.04. The recommender picks from this list using the rules below.
| Detected signal | Recommendation |
|---|---|
| PyTorch or CUDA detected | runpod/pytorch:* from docker_images.txt (fallback: runpod/pytorch:2.4.0-py3.11-cuda12.4.1-devel-ubuntu22.04) |
| TensorFlow or ONNX, no PyTorch | nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04 |
| No GPU framework detected | python:{python_version}-slim (default python:3.10-slim) |
APIPod renders apipod-deploy/Dockerfile from a Jinja template. The file installs system packages (always ffmpeg, gcc, g++, curl, ca-certificates), installs your requirements, installs runpod>=1.7.7, bakes the orchestrator/compute/provider env vars, exposes port 8000, and starts uvicorn on 0.0.0.0:8000.
FROM runpod/pytorch:2.4.0-py3.11-cuda12.4.1-devel-ubuntu22.04
# Always installed. ffmpeg covers media I/O, gcc/g++ cover native wheels.
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg gcc g++ curl ca-certificates python3-pip python3-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY . /app
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
# runpod>=1.7.7 is always installed, regardless of provider.
RUN pip install runpod>=1.7.7
RUN pip install .
ENV APIPOD_ORCHESTRATOR=local
ENV APIPOD_COMPUTE=dedicated
ENV APIPOD_PROVIDER=localhost
ENV APIPOD_HOST=0.0.0.0
ENV APIPOD_PORT=8000
EXPOSE 8000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]python:*-slim image. NVIDIA and RunPod bases already ship cuDNN, so the template skips the apt install on those. Drop a Dockerfile in your project root and APIPod uses it as-is instead of generating one. Match these conventions so the rest of the platform still works:
- Expose port
8000and bind uvicorn to0.0.0.0. - Start the service with
uvicorn {entrypoint}:app --host 0.0.0.0 --port 8000. - Install
runpod>=1.7.7regardless of provider. APIPod imports it at runtime. - Set the
APIPOD_*env vars (orchestrator, compute, provider, host, port) or pass them in at run time.
FROM runpod/pytorch:2.4.0-py3.11-cuda12.4.1-devel-ubuntu22.04
RUN apt-get update && apt-get install -y ffmpeg gcc g++ \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install runpod>=1.7.7
COPY . .
ENV APIPOD_HOST=0.0.0.0
ENV APIPOD_PORT=8000
EXPOSE 8000
CMD ["uvicorn", "service:app", "--host", "0.0.0.0", "--port", "8000"] The scanner writes the file below. Edit it between socaity scan and socaity build to override the entrypoint, pin a Python version, or force a specific base image.
{
"project": {
"name": "my-service",
"entrypoint": "main.py"
},
"python": {
"version": "3.10"
},
"frameworks": {
"pytorch": true,
"tensorflow": false,
"onnx": false,
"transformers": true,
"diffusers": false,
"cuda": true
},
"system_packages": ["ffmpeg"],
"model_files": [],
"env_file": true,
"base_image": ""
}