Skip to content

Commit

Permalink
docs: update docker usage
Browse files Browse the repository at this point in the history
Co-authored-by: tangramor <[email protected]>

close #158
  • Loading branch information
antfu committed Mar 7, 2024
1 parent 9aec249 commit 856b1a0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
18 changes: 18 additions & 0 deletions guide/exporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,24 @@ This command also accept multiple entries like for the [export command](#multipl

See [Static Hosting](/guide/hosting).

## Exportable Docker Image

To support the export feature, there is a [docker image](/guide/install#install-on-docker) (maintianed by [@tangramor](https://github.com/tangramor)) with tag **playwright**. Run following command in your work folder:

```bash
docker run --name slidev --rm -it \
-v ${PWD}:/slidev \
-p 3030:3030 \
-e NPM_MIRROR="https://registry.npmmirror.com" \
tangramor/slidev:playwright
```

Then you can use the export feature like following under your work folder:

```bash
docker exec -i slidev npx slidev export --timeout 2m --output slides.pdf
```

## Troubleshooting

### Timeout
Expand Down
4 changes: 3 additions & 1 deletion guide/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,12 @@ docker run --name slidev --rm -it \
--user node \
-v ${PWD}:/slidev \
-p 3030:3030 \
-e NPM_MIRROR="https://registry.npmmirror.com" \
tangramor/slidev:latest
```

**_Note_**: You can use `NPM_MIRROR` to specify a npm mirror to speed up the installation process.

If your work folder is empty, it will generate a template `slides.md` and other related files under your work folder, and launch the server on port `3030`.

You can access your slides from `http://localhost:3030/`
Expand All @@ -86,7 +89,6 @@ Or you can create your own slidev project to a docker image with Dockerfile:
FROM tangramor/slidev:latest

ADD . /slidev

```

Create the docker image: `docker build -t myppt .`
Expand Down

0 comments on commit 856b1a0

Please sign in to comment.