Skip to content

Commit 5235bd0

Browse files
authored
docs: fix Docker context, build arg, and actor.json path wording for monorepos (#3083)
1 parent 1c49ba3 commit 5235bd0

8 files changed

Lines changed: 15 additions & 13 deletions

File tree

‎apify-api/openapi/components/schemas/actors/ActorDefinition.yaml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ properties:
3131
description: A map of environment variables to be used during local development and deployment.
3232
dockerfile:
3333
type: string
34-
description: The path to the Dockerfile used for building the Actor on the platform.
34+
description: The path to the Dockerfile used for building the Actor on the platform, relative to the `.actor/` directory.
3535
dockerContextDir:
3636
type: string
37-
description: The path to the directory used as the Docker context when building the Actor.
37+
description: The path to the directory used as the Docker context when building the Actor, relative to the `.actor/` directory.
3838
readme:
3939
type: [string, "null"]
40-
description: The path to the README file for the Actor.
40+
description: The path to the README file for the Actor, relative to the `.actor/` directory.
4141
input:
4242
type: [object, "null"]
4343
description: The input schema object, the full specification can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/input-schema)
@@ -46,7 +46,7 @@ properties:
4646
description: The output schema object, the full specification can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/output-schema)
4747
changelog:
4848
type: [string, "null"]
49-
description: The path to the CHANGELOG file displayed in the Actor's information tab.
49+
description: The path to the CHANGELOG file displayed in the Actor's information tab, relative to the `.actor/` directory.
5050
storages:
5151
type: object
5252
properties:

‎apify-api/openapi/components/schemas/actors/CreateVersionRequest.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ properties:
3535
description: URL of the Git repository to clone the source code from. Applies when the `sourceType` is `GIT_REPO`.
3636
tarballUrl:
3737
type: string
38-
description: URL of the tarball to download the source code from. Applies when the `sourceType` is `TARBALL`.
38+
description: URL of the zip archive to download the source code from. Applies when the `sourceType` is `TARBALL`.
3939
gitHubGistUrl:
4040
type: string
4141
description: URL of the GitHub Gist to clone the source code from. Applies when the `sourceType` is `GITHUB_GIST`.

‎apify-api/openapi/components/schemas/actors/UpdateVersionRequest.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ properties:
3232
description: URL of the Git repository to clone the source code from. Applies when the `sourceType` is `GIT_REPO`.
3333
tarballUrl:
3434
type: string
35-
description: URL of the tarball to download the source code from. Applies when the `sourceType` is `TARBALL`.
35+
description: URL of the zip archive to download the source code from. Applies when the `sourceType` is `TARBALL`.
3636
gitHubGistUrl:
3737
type: string
3838
description: URL of the GitHub Gist to clone the source code from. Applies when the `sourceType` is `GITHUB_GIST`.

‎apify-api/openapi/components/schemas/actors/Version.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ properties:
3939
description: URL of the Git repository to clone the source code from. Applies when the `sourceType` is `GIT_REPO`.
4040
tarballUrl:
4141
type: [string, "null"]
42-
description: URL to download the source code from as a tarball or ZIP file. Applies when the `sourceType` is `TARBALL`.
42+
description: URL to download the source code from as a zip archive. Applies when the `sourceType` is `TARBALL`.
4343
gitHubGistUrl:
4444
type: [string, "null"]
4545
description: URL of the GitHub Gist to clone the source code from. Applies when the `sourceType` is `GITHUB_GIST`.

‎apify-api/openapi/components/tags.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
|---|---|
4141
| `"SOURCE_FILES"` | Source code is comprised of multiple files specified in the `sourceFiles` array. Each item of the array is an object with the following fields:<br/> - `name`: File path and name<br/> - `format`: Format of the content, can be either `"TEXT"` or `"BASE64"`<br/> - `content`: File content<br/><br/>Source files can be shown and edited in the Apify Console's Web IDE. |
4242
| `"GIT_REPO"` | Source code is cloned from a Git repository, whose URL is specified in the `gitRepoUrl` field. |
43-
| `"TARBALL"` | Source code is downloaded using a tarball or Zip file from a URL specified in the `tarballUrl` field. |
43+
| `"TARBALL"` | Source code is downloaded as a zip archive from a URL specified in the `tarballUrl` field. |
4444
|`"GITHUB_GIST"`| Source code is taken from a GitHub Gist, whose URL is specified in the `gitHubGistUrl` field. |
4545
4646
For more information about source code and Actor versions, check out [Source code](https://docs.apify.com/platform/actors/development/actor-definition/source-code)

‎sources/platform/actors/development/actor_definition/actor_json.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ Actor `name`, `version`, `buildTag`, and `environmentVariables` are currently on
7070

7171
:::
7272

73+
Path values are relative to the `.actor/` directory, so `../` points to the Actor's directory. This applies to `dockerfile`, `dockerContextDir`, `readme`, and `changelog`. It also applies to `input`, `output`, `storages.dataset`, `storages.datasets`, `storages.keyValueStore`, and `webServerSchema` when they hold a file path instead of an embedded object.
74+
7375
| Property | Type | Description |
7476
| --- | --- | --- |
7577
| `actorSpecification` | Required | The version of the Actor specification. This property must be set to `1`, which is the only version available. |

‎sources/platform/actors/development/actor_definition/docker.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ Apify uses Docker to build and run Actors. If you create an Actor from a templat
187187

188188
To use a custom `Dockerfile`, you can either:
189189

190-
- Reference it from the `dockerfile` field in `.actor/actor.json`,
191-
- Store it in `.actor/Dockerfile` or `Dockerfile` in the root directory (searched in this order of preference).
190+
- Set the `dockerfile` field in `.actor/actor.json` to the Dockerfile's path, relative to `.actor/`,
191+
- Store it in `.actor/Dockerfile` or `Dockerfile` in the Actor's directory (searched in this order of preference).
192192

193193
If no `Dockerfile` is provided, the system uses the following default:
194194

‎sources/platform/actors/development/deployment/source_types.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ Apify generates a unique deployment key for each Actor, so you don't need to reu
8080

8181
### Actor monorepos
8282

83-
To manage multiple Actors in a single repository, use the `dockerContextDir` property in the [Actor definition](/actors/development/actor-definition/actor-json) to set the Docker context directory (if not provided then the repository root is used). In the Dockerfile, copy both the Actor's source and any shared code into the Docker image.
83+
By default, the Docker context is the Actor's directory, which contains `.actor/actor.json`, so the Dockerfile can't copy shared code from outside it. To manage multiple Actors in a single repository, set the `dockerContextDir` property in the [Actor definition](/actors/development/actor-definition/actor-json). Point it to a directory that contains both the Actor and the shared code, usually the repository root. The path is relative to `.actor/`, for example `../../..` for an Actor in `actors/javascript-actor`. In the Dockerfile, copy both the Actor's source and any shared code into the Docker image.
8484

8585
To enable sharing Dockerfiles between multiple Actors, the Actor build process passes the `ACTOR_PATH_IN_DOCKER_CONTEXT` build argument to the Docker build.
86-
It contains the relative path from `dockerContextDir` to the directory selected as the root of the Actor in Apify Console (the "directory" part of the Actor's git URL).
86+
It contains the relative path from the Docker context to the Actor's directory. For a Git repository source, the Actor's directory is the one you add to the URL after the branch or tag, such as `actors/javascript-actor` in `#main:actors/javascript-actor`. When the Docker context is the Actor's directory, the value is an empty string.
8787

8888
For an example, see the [`apify/actor-monorepo-example`](https://github.com/apify/actor-monorepo-example) repository. To build Actors from this monorepo, you would set the source URL (including branch name and folder) as `https://github.com/apify/actor-monorepo-example#main:actors/javascript-actor` and `https://github.com/apify/actor-monorepo-example#main:actors/typescript-actor` respectively.
8989

@@ -93,7 +93,7 @@ Actors can also use source code from a Zip archive hosted on an external URL. Th
9393

9494
:::note Automatic use of ZIP file
9595

96-
This source type is used automatically when you are using Apify-CLI and the source size exceeds `3MB`.
96+
When you deploy with the [Apify CLI](/cli) and the source exceeds 3 MB, the CLI uses this source type automatically.
9797

9898
:::
9999

0 commit comments

Comments
 (0)