Skip to content

Commit

Permalink
docs: Add Docker and nginx documentation for local development
Browse files Browse the repository at this point in the history
  • Loading branch information
fmartingr committed Jan 1, 2025
1 parent c32f9a8 commit 51941ed
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ help:
clean:
rm -rf dist

## Runs the legacy http API for local development
.PHONY: serve
serve:
SHIORI_DEVELOPMENT=$(SHIORI_DEVELOPMENT) SHIORI_DIR=$(SHIORI_DIR) go run main.go serve

## Runs server for local development
.PHONY: run-server
run-server:
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ services:
- "mariadb"
environment:
SHIORI_DIR: /srv/shiori
SHIORI_HTTP_ROOT_PATH: /shiori
#SHIORI_DATABASE_URL: mysql://shiori:shiori@(mariadb)/shiori?charset=utf8mb4
SHIORI_DATABASE_URL: postgres://shiori:shiori@postgres/shiori?sslmode=disable
# SHIORI_HTTP_ROOT_PATH: /shiori
# SHIORI_DATABASE_URL: mysql://shiori:shiori@(mariadb)/shiori?charset=utf8mb4
# SHIORI_DATABASE_URL: postgres://shiori:shiori@postgres/shiori?sslmode=disable

nginx:
image: nginx:alpine
Expand Down
26 changes: 26 additions & 0 deletions docs/Contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,30 @@ Documentation for production is generated automatically on every release and pub

## Running the server with docker

To run the development server using Docker, you can use the provided `docker-compose.yaml` file which includes both PostgreSQL and MariaDB databases:

```bash
docker compose up shiori
```

This will start the Shiori server on port 8080 with hot-reload enabled. Any changes you make to the code will automatically rebuild and restart the server.

By default, it uses SQLite mounting the local `dev-data` folder in the source code path. To use MariaDB or PostgreSQL instead, uncomment the `SHIORI_DATABASE_URL` line for the appropriate engine in the `docker-compose.yaml` file.

## Running the server using an nginx reverse proxy and a custom webroot

To test Shiori behind an nginx reverse proxy with a custom webroot (e.g., `/shiori/`), you can use the provided nginx configuration:

1. First, ensure the `SHIORI_HTTP_ROOT_PATH` environment variable is uncommented in `docker-compose.yaml`:
```yaml
SHIORI_HTTP_ROOT_PATH: /shiori/
```
2. Then start both Shiori and nginx services:
```bash
docker compose up shiori nginx
```

This will start the shiori service along with nginx. You can access Shiori using [http://localhost:8081/shiori](http://localhost:8081/shiori).

The nginx configuration in `testdata/nginx.conf` handles all the necessary configuration.

0 comments on commit 51941ed

Please sign in to comment.