mirror of
https://github.com/allankoechke/mantisbase-demo.git
synced 2026-11-29 09:16:54 +00:00
Making Dockerfile independent to be ran on dockploy
This commit is contained in:
@@ -21,3 +21,7 @@ ENV NODE_ENV=production
|
||||
|
||||
COPY --from=ui-builder /app/out/ ./public/
|
||||
COPY db/data ./data-default/
|
||||
COPY scripts/docker-entrypoint.sh /entrypoint.sh
|
||||
|
||||
EXPOSE 80
|
||||
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]
|
||||
|
||||
24
README.md
24
README.md
@@ -9,9 +9,6 @@ The dashboard lives in the `mb` sub‑directory and is built as a Next.js applic
|
||||
A more complete description of the dashboard, its features and development
|
||||
workflow can be found in `mb/README.md`.
|
||||
|
||||
> ⚠️ The `docker-compose.yaml` file is currently empty – you can either fill it
|
||||
> yourself or run the container directly with `docker` commands as shown below.
|
||||
|
||||
## 🚀 Getting Started
|
||||
|
||||
### Prerequisites
|
||||
@@ -22,33 +19,32 @@ workflow can be found in `mb/README.md`.
|
||||
|
||||
### Building the image
|
||||
|
||||
The simple `Dockerfile` in the root directory uses the `mantisbase:latest` base
|
||||
image and copies the pre‑built dashboard files into `/mb` inside the container.
|
||||
The `Dockerfile` builds the admin UI, copies it and a default DB into the
|
||||
mantisbase image, and sets the entrypoint so the container is ready to run
|
||||
without docker-compose.
|
||||
|
||||
```bash
|
||||
# build the demo image from this repository
|
||||
docker build -t mantisbase-demo .
|
||||
```
|
||||
|
||||
### Running the service
|
||||
|
||||
You can start a container from the image and expose the default MantisBase port
|
||||
(7070) to your host:
|
||||
The app listens on port **80** inside the container. Map it to your host (e.g. 7088):
|
||||
|
||||
```bash
|
||||
docker run --rm -p 7070:7070 mantisbase-demo
|
||||
docker run -d --restart always -p 7088:80 mantisbase-demo
|
||||
```
|
||||
|
||||
Once the server is running you can navigate to `http://localhost:7070/` to hit the
|
||||
API and to `http://localhost:7070/mb/` to access the admin dashboard.
|
||||
Then open `http://localhost:7088/` for the API and `http://localhost:7088/mb/` for the admin dashboard.
|
||||
|
||||
If you prefer to use `docker-compose`, add the appropriate service definition to
|
||||
`docker-compose.yaml` and execute:
|
||||
**Optional:** To use a host-backed database instead of the in-image default, mount your data directory read-only as `/db-default`:
|
||||
|
||||
```bash
|
||||
docker-compose up --build
|
||||
docker run -d --restart always -p 7088:80 -v "$(pwd)/db/data:/db-default:ro" mantisbase-demo
|
||||
```
|
||||
|
||||
The entrypoint resets and restarts the server every 30 minutes; with `--restart always`, the container will come back and reload data from `/db-default` or the image default.
|
||||
|
||||
## Development
|
||||
|
||||
To work on the admin dashboard, change into the `mb` directory and follow the
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# Used by docker-compose: copy default DB into /mb/data, run mantisbase on port 80,
|
||||
# then exit after 30 minutes so the container restarts (restart: always) and data resets.
|
||||
# DB source: host mount /db-default if present and non-empty, else image /mb/data-default.
|
||||
# Copy default DB into /mb/data, run mantisbase on port 80, then exit after 30 minutes
|
||||
# so the container restarts and data resets. DB source: host mount /db-default if
|
||||
# present and non-empty, else image /mb/data-default.
|
||||
|
||||
set -e
|
||||
mkdir -p /mb/data
|
||||
|
||||
Reference in New Issue
Block a user