Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Get simple debian image
FROM debian:latest
LABEL org.opencontainers.image.source=https://github.com/gbdev/gb-asm-tutorial
SHELL ["bash", "-lc"]
RUN apt update
RUN apt install curl -y

# Install rust and mdbook
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN apt install gcc -y
RUN source "$HOME/.cargo/env"
RUN cargo install mdbook@0.4.52

COPY . /code
WORKDIR /code

# Serve gb-asm-tutorial
# See https://github.com/rust-lang/mdBook/issues/2226
RUN mdbook build
CMD mdbook serve --hostname 0.0.0.0 & mdbook watch
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ You can read it at https://gbdev.io/gb-asm-tutorial/.

Contributing is really easy, fork this repo and edit the files in the **src** directory. Then, you can send your PR.

### Deploy Locally

To deploy gb-asm-tutorial locally:

1. Install [Rust](https://www.rust-lang.org/tools/install) and [mdBook](https://github.com/rust-lang/mdBook#readme) (v0.4.x).
Expand All @@ -28,6 +30,27 @@ mdbook build
mdbook watch
```

### Deploy with Docker

If you have [Docker installed](https://docs.docker.com/engine/install/), you can build the Docker image with:

```sh
docker build -t gb-asm-tutorial .
```

Then run the image with:

```sh
docker run -p 3000:3000 \
--mount "type=bind,source=$(pwd)/preproc,target=/code/preproc" \
--mount "type=bind,source=$(pwd)/renderer,target=/code/renderer" \
--mount "type=bind,source=$(pwd)/src,target=/code/src" \
--mount "type=bind,source=$(pwd)/theme,target=/code/theme" \
-it gb-asm-tutorial
```

That's it! gb-asm-tutorial is live at [localhost:3000](https://localhost:3000).

## Translating

To help translate the tutorial, join the [project on Crowdin](https://crowdin.com/project/gb-asm-tutorial).
Expand Down
Loading