Skip to content

Commit

Permalink
fix running with Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
le4ker committed Feb 7, 2024
1 parent f2b2a42 commit 444e8ab
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 21 deletions.
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM jekyll/jekyll:latest

WORKDIR /srv/jekyll
COPY . .
RUN gem install webrick
RUN ./scripts/generate-tags
RUN ./scripts/generate-categories
CMD ["jekyll", "serve", "--watch", "--host", "0.0.0.0", "--config", "_config.yml,_config.dev.yml"]
19 changes: 4 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,13 @@ Then, you can build and serve your website by simply running:
./scripts/serve-production
```

To serve across lan (requires su to forward the port 4000 over lan):
### Run using Docker

```shell
./scripts/serve-lan-production
```

### Docker

Run using Docker:

```shell
docker run --rm -it -p 4000:4000 -v "$PWD:/srv/jekyll" jekyll/jekyll jekyll serve --watch --host "0.0.0.0" --config _config.yml,_config.dev.yml
```

Run using Docker with Docker Compose:
Alternatively, you can use Docker to run the website to avoid installing any
dependencies to your local environment. To do so, run:

```shell
docker-compose up
docker-compose up --build
```

## OSS used in { Personal }
Expand Down
1 change: 1 addition & 0 deletions _config.dev.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
url: "0.0.0.0:4000"
baseurl: ""
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,6 @@ paginate_path: "blog/page:num/"
# Enable minification SASS
sass:
style: compressed
gems:
plugins:
- jekyll-paginate
- jemoji
8 changes: 3 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
version: "3"
version: "3.8"
services:
jekyll:
image: jekyll/jekyll
build: .
platform: linux/amd64
ports:
- "4000:4000"
command: jekyll serve --watch --host "0.0.0.0" --config _config.yml,_config.dev.yml
volumes:
- .:/srv/jekyll

0 comments on commit 444e8ab

Please sign in to comment.