Skip to content

Commit

Permalink
updated docs with playwright and docker compose examples (#331)
Browse files Browse the repository at this point in the history
Co-authored-by: Alper Ortac <[email protected]>
  • Loading branch information
alp82 and Alper Ortac authored Oct 8, 2023
1 parent 2d1e029 commit 8911656
Showing 1 changed file with 44 additions and 2 deletions.
46 changes: 44 additions & 2 deletions docs/advanced/8_preinstall_binaries/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ Below are the steps and examples to extend the base image:
FROM ghcr.io/windmill-labs/windmill:main
# or FROM ghcr.io/windmill-labs/windmill-ee:main for extending the enterprise edition

RUN apt-get update && apt install ....
RUN apt-get update && apt install [...]

CMD ["windmill"]
```

## Example: Installing Puppeteer
## Example: Installing Puppeteer (via npm)

```dockerfile
FROM ghcr.io/windmill-labs/windmill-ee:main
Expand All @@ -35,6 +35,48 @@ CMD ["windmill"]

> Note: The example above uses the enterprise edition (`windmill-ee`) as the base.
## Example: Installing Playwright (via pip)

```dockerfile
FROM ghcr.io/windmill-labs/windmill-ee:main

RUN pip install playwright
RUN playwright install
RUN playwright install-deps

CMD ["windmill"]
```

> Note: The example above uses the enterprise edition (`windmill-ee`) as the base.
## Examples with docker compose

All examples above can be used in your [`docker-compose.yml`](https://github.com/windmill-labs/windmill/blob/main/docker-compose.yml) by specifying the build context.0

Replace:
```
windmill_worker:
image: ${WM_IMAGE}
```

With the following:
```
windmill_worker:
build:
context: ./path/to/dockerfile
args:
WM_IMAGE: ${WM_IMAGE}
```

Note that you can pass environment variables from your `.env` file via the args above and use them in your `Dockerfile`:
```dockerfile
ARG WM_IMAGE
FROM ${WM_IMAGE}

[...]
```


## Init Scripts

Init scripts provide a method to pre-install binaries or set initial configurations without the need to modify the base image. This approach offers added convenience. Init Scripts are executed at the beginning when the worker starts, ensuring that any necessary binaries or configurations are set up before the worker undertakes any other job.
Expand Down

0 comments on commit 8911656

Please sign in to comment.