Source Code Build Procedure
Obtain the Dify source code and build the API and web frontend from the source code.
- Obtain the Dify source code.
1git clone --branch 1.13.3 --depth 1 https://github.com/langgenius/dify.git
- Check the API and web version requirements (this step is used to confirm that no build is required on the API side).
1 2 3 4 5 6 7 8 9 10
cd dify python3 - <<'PY' import tomllib api = tomllib.load(open("api/pyproject.toml", "rb")) print("api_name=" + api["project"]["name"]) print("api_version=" + api["project"]["version"]) print("api_requires_python=" + api["project"]["requires-python"]) print("api_package=" + str(api.get("tool", {}).get("uv", {}).get("package"))) PY
The information is expected to include the following:1 2 3 4
api_name=dify-api api_version=1.13.3 api_requires_python=>=3.11,<3.13 api_package=False
api_package=False indicates that no build is required on the API side. The executable content of the API includes the api/ source code directory, installed Python dependencies, and runtime configuration.
- Build the web frontend from the source code.
1 2 3
cd web pnpm install --frozen-lockfile pnpm build
This step generates Next.js build products from the source code. The following is an example of the build products. For details about the build products, see Table 1.1 2 3 4
.next/BUILD_ID .next/routes-manifest.json .next/required-server-files.json public/manifest.json
Table 1 Web build product description Product
Description
.next/BUILD_ID
Unique ID of the current web build.
.next/routes-manifest.json
Next.js route build result.
.next/required-server-files.json
List of files required for starting the web service.
public/manifest.json
List of frontend static resources.
Parent topic: Developer Guide