Skip to content

Commit

Permalink
Create docker-compose.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed May 10, 2024
1 parent 6a44af3 commit fcb94d4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The starter template for [Hugo Bootstrap Theme](https://github.com/razonyang/hug

## Usage

Please make sure you have install the [build tools](https://hbs.razonyang.com/v1/en/docs/getting-started/prerequisites/#build-tools) prior to using this template.
Please make sure you have install the [build tools](https://hbs.razonyang.com/v1/en/docs/getting-started/prerequisites/#build-tools) prior to using this template if you're not using Docker to preview site.

**1. Clone this repository**

Expand Down Expand Up @@ -66,12 +66,30 @@ module:
proxy: https://goproxy.cn
```
## Server
## Local Development
### Develop via Docker Compose
**1.Install Dependencies**
```sh
$ docker compose run server npm ci
```

> This step is one-time task per machine, unless you deleted the __node_modules__ folder or introduce new dependencies.
**2. Start server**

```sh
$ docker compose up
```

### Develop with Native Tools

**1. Install dependencies**

```shell
$ npm i
$ npm ci
```

Generally, this step only needs to be performed once for each local project.
Expand Down
11 changes: 11 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: my-blog

services:
server:
image: hugomods/hugo:exts
command: hugo server --bind 0.0.0.0
volumes:
- $PWD:/src
- $HOME/.cache/docker_compose_hugo_cache:/tmp/hugo_cache
ports:
- 1313:1313

0 comments on commit fcb94d4

Please sign in to comment.