-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow the wiki to be hosted locally on watch mode (#422)
* allow the wiki to be hosted locally on watch mode * improve code & add wrap button * Revert "improve code & add wrap button" This reverts commit 81a0d88. * Update Dockerfile Co-authored-by: Bartłomiej Skoczeń <[email protected]> * Update dev.sh Co-authored-by: Bartłomiej Skoczeń <[email protected]> * Change the image to Ubuntu and use gh cli to get packages * remove curl --------- Co-authored-by: Bartłomiej Skoczeń <[email protected]>
- Loading branch information
1 parent
8dcb2f0
commit ee17009
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Use an Ubuntu base image | ||
FROM ubuntu | ||
|
||
# Install gh cli | ||
RUN (type -p wget >/dev/null || (apt update && apt-get install wget -y)) \ | ||
&& mkdir -p -m 755 /etc/apt/keyrings \ | ||
&& wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \ | ||
&& chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ | ||
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ | ||
&& apt update \ | ||
&& apt install gh -y | ||
|
||
# Set config to ssh to bypass auth login | ||
RUN gh config set git_protocol ssh -h github.com | ||
|
||
# Download required packages | ||
RUN gh release download -R rust-lang/mdBook -p mdbook-*-x86_64-unknown-linux-gnu.tar.gz | ||
RUN gh release download -R tommilligan/mdbook-admonish -p mdbook-admonish-*-x86_64-unknown-linux-gnu.tar.gz | ||
RUN gh release download -R NilPointer-Software/mdbook-discord-components -p mdbook-discord-components-*.tar.gz | ||
|
||
# Set the working directory for your mdbook project | ||
WORKDIR /app | ||
|
||
# Expose working port | ||
EXPOSE 3000 | ||
|
||
# Copy dev run script | ||
COPY dev.sh . | ||
|
||
# Run your start script | ||
CMD ["sh", "dev.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
for file in /*.tar.gz | ||
do tar xzf "$file" -C /usr/local/bin | ||
rm $file | ||
done | ||
|
||
mdbook-admonish install --css-dir src/theme | ||
mdbook serve --port 3000 -n 0.0.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
services: | ||
mdbook-service: | ||
build: . | ||
volumes: | ||
- ./:/app:rw | ||
ports: | ||
- "3000:3000" |