Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update docker usage #158

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 bigger docker image with tag **playwright**. Just 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
10 changes: 7 additions & 3 deletions guide/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,15 @@ docker run --name slidev --rm -it \
--user node \
-v ${PWD}:/slidev \
-p 3030:3030 \
-e NPM_MIRROR="https://registry.npmmirror.com" \
tangramor/slidev:latest
```

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`.
***Note***: You can use `NPM_MIRROR` to specify a npm mirror to speed up the installation process.

You can access your slides from `http://localhost:3030/`
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/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quotes are intentionally, otherwise VitePress will fail as it to be a deadlink


### Build deployable image

Expand All @@ -91,7 +94,7 @@ Create the docker image: `docker build -t myppt .`

And run the container: `docker run --name myslides --rm --user node -p 3030:3030 myppt`

You can visit your slides from `http://localhost:3030/`
You can visit your slides from http://localhost:3030/

### Build hostable SPA (Single Page Application)

Expand Down Expand Up @@ -119,6 +122,7 @@ Or create a static image with following Dockerfile:
FROM nginx:alpine

COPY dist /usr/share/nginx/html

```

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