diff --git a/Makefile b/Makefile index bbac69fae..0588088a4 100644 --- a/Makefile +++ b/Makefile @@ -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: diff --git a/docker-compose.yaml b/docker-compose.yaml index 97c19251d..eeb2b43eb 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -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 diff --git a/docs/Contribute.md b/docs/Contribute.md index 6b5388c84..6cef5a55a 100644 --- a/docs/Contribute.md +++ b/docs/Contribute.md @@ -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.