Skip to content

Commit c8febb1

Browse files
committed
docs: Add Docker and nginx documentation for local development
1 parent c32f9a8 commit c8febb1

File tree

3 files changed

+29
-8
lines changed

3 files changed

+29
-8
lines changed

Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ help:
5757
clean:
5858
rm -rf dist
5959

60-
## Runs the legacy http API for local development
61-
.PHONY: serve
62-
serve:
63-
SHIORI_DEVELOPMENT=$(SHIORI_DEVELOPMENT) SHIORI_DIR=$(SHIORI_DIR) go run main.go serve
64-
6560
## Runs server for local development
6661
.PHONY: run-server
6762
run-server:

docker-compose.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ services:
2222
- "mariadb"
2323
environment:
2424
SHIORI_DIR: /srv/shiori
25-
SHIORI_HTTP_ROOT_PATH: /shiori
26-
#SHIORI_DATABASE_URL: mysql://shiori:shiori@(mariadb)/shiori?charset=utf8mb4
27-
SHIORI_DATABASE_URL: postgres://shiori:shiori@postgres/shiori?sslmode=disable
25+
# SHIORI_HTTP_ROOT_PATH: /shiori/
26+
# SHIORI_DATABASE_URL: mysql://shiori:shiori@(mariadb)/shiori?charset=utf8mb4
27+
# SHIORI_DATABASE_URL: postgres://shiori:shiori@postgres/shiori?sslmode=disable
2828

2929
nginx:
3030
image: nginx:alpine

docs/Contribute.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,30 @@ Documentation for production is generated automatically on every release and pub
8989

9090
## Running the server with docker
9191

92+
To run the development server using Docker, you can use the provided `docker-compose.yaml` file which includes both PostgreSQL and MariaDB databases:
93+
94+
```bash
95+
docker compose up shiori
96+
```
97+
98+
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.
99+
100+
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.
101+
92102
## Running the server using an nginx reverse proxy and a custom webroot
103+
104+
To test Shiori behind an nginx reverse proxy with a custom webroot (e.g., `/shiori/`), you can use the provided nginx configuration:
105+
106+
1. First, ensure the `SHIORI_HTTP_ROOT_PATH` environment variable is uncommented in `docker-compose.yaml`:
107+
```yaml
108+
SHIORI_HTTP_ROOT_PATH: /shiori/
109+
```
110+
111+
2. Then start both Shiori and nginx services:
112+
```bash
113+
docker compose up shiori nginx
114+
```
115+
116+
This will start the shiori service along with nginx. You can access Shiori using [http://localhost:8081/shiori](http://localhost:8081/shiori).
117+
118+
The nginx configuration in `testdata/nginx.conf` handles all the necessary configuration.

0 commit comments

Comments
 (0)