Skip to content

Commit 856b1a0

Browse files
committed
docs: update docker usage
Co-authored-by: tangramor <[email protected]> close #158
1 parent 9aec249 commit 856b1a0

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

guide/exporting.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,24 @@ This command also accept multiple entries like for the [export command](#multipl
131131

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

134+
## Exportable Docker Image
135+
136+
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:
137+
138+
```bash
139+
docker run --name slidev --rm -it \
140+
-v ${PWD}:/slidev \
141+
-p 3030:3030 \
142+
-e NPM_MIRROR="https://registry.npmmirror.com" \
143+
tangramor/slidev:playwright
144+
```
145+
146+
Then you can use the export feature like following under your work folder:
147+
148+
```bash
149+
docker exec -i slidev npx slidev export --timeout 2m --output slides.pdf
150+
```
151+
134152
## Troubleshooting
135153

136154
### Timeout

guide/install.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,12 @@ docker run --name slidev --rm -it \
7171
--user node \
7272
-v ${PWD}:/slidev \
7373
-p 3030:3030 \
74+
-e NPM_MIRROR="https://registry.npmmirror.com" \
7475
tangramor/slidev:latest
7576
```
7677

78+
**_Note_**: You can use `NPM_MIRROR` to specify a npm mirror to speed up the installation process.
79+
7780
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`.
7881

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

8891
ADD . /slidev
89-
9092
```
9193

9294
Create the docker image: `docker build -t myppt .`

0 commit comments

Comments
 (0)