Prepare backend for frontend integration

This commit is contained in:
kosmos committed 2026-08-25 00:32:34 +00:00
1 parent 739c22550c
commit f8fb871bcc
4 files changed
+12 -7

No files matched your search

+2 -2
View File
@@ -1,5 +1,5 @@
# Host port of the Drivers Hub API. # Address and port on the Docker host.
HUB_PORT=7777 BACKEND_BIND=127.0.0.1:17777
DB_NAME=drivershub DB_NAME=drivershub
DB_PASSWORD=replace-with-a-long-random-password DB_PASSWORD=replace-with-a-long-random-password
+1
View File
@@ -36,6 +36,7 @@ RUN apt-get update \
WORKDIR /app WORKDIR /app
COPY --from=builder --chown=drivershub:drivershub /build/dist/ ./ COPY --from=builder --chown=drivershub:drivershub /build/dist/ ./
COPY --from=builder --chown=drivershub:drivershub /build/src/external_plugins/ ./external_plugins/
COPY --chown=root:root docker/entrypoint.sh /usr/local/bin/drivershub-entrypoint COPY --chown=root:root docker/entrypoint.sh /usr/local/bin/drivershub-entrypoint
USER drivershub USER drivershub
+8 -4
View File
@@ -27,7 +27,7 @@ Set secure MariaDB passwords in `.env`. Then, set at least these values in
```json ```json
{ {
"abbr": "drivershub", "abbr": "api",
"name": "Drivers Hub", "name": "Drivers Hub",
"domain": "hub.example.com", "domain": "hub.example.com",
"prefix": "/api", "prefix": "/api",
@@ -39,7 +39,8 @@ Set secure MariaDB passwords in `.env`. Then, set at least these values in
"db_name": "drivershub", "db_name": "drivershub",
"db_data_directory": "/var/lib/mysqlext/", "db_data_directory": "/var/lib/mysqlext/",
"redis_host": "valkey", "redis_host": "valkey",
"redis_port": 6379 "redis_port": 6379,
"external_plugins": ["client-config"]
} }
``` ```
@@ -50,6 +51,8 @@ from `config_sample.json`. Restart the backend after you change
Use the same database password in `.env` and `config/config.json`. Use the same database password in `.env` and `config/config.json`.
Set `domain` to the public host name of the backend. Do not include a protocol or Set `domain` to the public host name of the backend. Do not include a protocol or
path. path.
Set `prefix` to `/{abbr}` when you use the official frontend. The
`client-config` plugin uses this relation to create frontend API URLs.
## Start the deployment ## Start the deployment
@@ -59,8 +62,9 @@ docker compose up -d
docker compose ps docker compose ps
``` ```
By default, the API is available at `http://localhost:7777/api`. Swagger UI is By default, the API is available at `http://localhost:17777/api`. Swagger UI is
available at `http://localhost:7777/api/doc`. available at `http://localhost:17777/api/doc`.
The default bind address is suitable for a reverse proxy on the Docker host.
## Store persistent data ## Store persistent data
+1 -1
View File
@@ -60,7 +60,7 @@ services:
volumes: volumes:
- ./config:/app/config - ./config:/app/config
ports: ports:
- "${HUB_PORT:-7777}:7777" - "${BACKEND_BIND:-127.0.0.1:17777}:7777"
depends_on: depends_on:
db-init: db-init:
condition: service_completed_successfully condition: service_completed_successfully