Skip to content

Commit 7cd7530

Browse files
authored
Merge pull request #41 from yang-young/main
Fix: dockerfile cmd for npm and pnpm
2 parents e427891 + 0051fbe commit 7cd7530

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

docs/deployment/docker/_partials/_dockerfile-npm.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ WORKDIR /opt/docusaurus
1818
## Expose the port that Docusaurus will run on.
1919
EXPOSE 3000
2020
## Run the development server.
21-
CMD [ -d "node_modules" ] && npm run start --host 0.0.0.0 --poll 1000 || npm run install && npm run start --host 0.0.0.0 --poll 1000
21+
CMD [ -d "node_modules" ] && npm run start -- --host 0.0.0.0 --poll 1000 || npm install && npm run start -- --host 0.0.0.0 --poll 1000
2222
2323
# Stage 2b: Production build mode.
2424
FROM base as prod

docs/deployment/docker/_partials/_dockerfile-pnpm.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ WORKDIR /opt/docusaurus
1818
## Expose the port that Docusaurus will run on.
1919
EXPOSE 3000
2020
## Run the development server.
21-
CMD [ -d "node_modules" ] && pnpm start --host 0.0.0.0 --poll 1000 || pnpm install && pnpm start --host 0.0.0.0 --poll 1000
21+
CMD [ -d "node_modules" ] && pnpm start -- --host 0.0.0.0 --poll 1000 || pnpm install && pnpm start -- --host 0.0.0.0 --poll 1000
2222
2323
# Stage 2b: Production build mode.
2424
FROM base as prod
@@ -36,7 +36,7 @@ FROM prod as serve
3636
## Expose the port that Docusaurus will run on.
3737
EXPOSE 3000
3838
## Run the production server.
39-
CMD ["pnpm", "serve", "--host", "0.0.0.0", "--no-open"]
39+
CMD ["pnpm", "serve", "--", "--host", "0.0.0.0", "--no-open"]
4040
4141
# Stage 3b: Serve with Caddy.
4242
FROM caddy:2-alpine as caddy

docs/deployment/docker/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Depending on stage / target you will need to run the docker image differently.
117117
To run the `dev` target you will need to run the following command:
118118
119119
```bash
120-
docker run --rm -d -p 3000:3000 -v $(pwd):/var/docusaurus <tag>
120+
docker run --rm -d -p 3000:3000 -v $(pwd):/opt/docusaurus <tag>
121121
```
122122
123123
If using PowerShell you will need to use `${pwd}` instead of `$(pwd)`. On some systems you may need to replace `$(pwd)` with `.` or the full path to the directory you want to mount.

0 commit comments

Comments
 (0)