Prepare backend for frontend integration
This commit is contained in:
1 parent
739c22550c
commit
f8fb871bcc
4 files changed
+12
-7
No files matched your search
+2
-2
@@ -1,5 +1,5 @@
|
||||
# Host port of the Drivers Hub API.
|
||||
HUB_PORT=7777
|
||||
# Address and port on the Docker host.
|
||||
BACKEND_BIND=127.0.0.1:17777
|
||||
|
||||
DB_NAME=drivershub
|
||||
DB_PASSWORD=replace-with-a-long-random-password
|
||||
|
||||
@@ -36,6 +36,7 @@ RUN apt-get update \
|
||||
WORKDIR /app
|
||||
|
||||
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
|
||||
|
||||
USER drivershub
|
||||
|
||||
@@ -27,7 +27,7 @@ Set secure MariaDB passwords in `.env`. Then, set at least these values in
|
||||
|
||||
```json
|
||||
{
|
||||
"abbr": "drivershub",
|
||||
"abbr": "api",
|
||||
"name": "Drivers Hub",
|
||||
"domain": "hub.example.com",
|
||||
"prefix": "/api",
|
||||
@@ -39,7 +39,8 @@ Set secure MariaDB passwords in `.env`. Then, set at least these values in
|
||||
"db_name": "drivershub",
|
||||
"db_data_directory": "/var/lib/mysqlext/",
|
||||
"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`.
|
||||
Set `domain` to the public host name of the backend. Do not include a protocol or
|
||||
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
|
||||
|
||||
@@ -59,8 +62,9 @@ docker compose up -d
|
||||
docker compose ps
|
||||
```
|
||||
|
||||
By default, the API is available at `http://localhost:7777/api`. Swagger UI is
|
||||
available at `http://localhost:7777/api/doc`.
|
||||
By default, the API is available at `http://localhost:17777/api`. Swagger UI is
|
||||
available at `http://localhost:17777/api/doc`.
|
||||
The default bind address is suitable for a reverse proxy on the Docker host.
|
||||
|
||||
## Store persistent data
|
||||
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ services:
|
||||
volumes:
|
||||
- ./config:/app/config
|
||||
ports:
|
||||
- "${HUB_PORT:-7777}:7777"
|
||||
- "${BACKEND_BIND:-127.0.0.1:17777}:7777"
|
||||
depends_on:
|
||||
db-init:
|
||||
condition: service_completed_successfully
|
||||
|
||||
Reference in new issue
Block a user