Skip to main content

Admin System: Deploy

Each half is packaged its own way: the Web Admin is a static build that nginx serves, and the API is a Spring Boot jar that runs in a JRE container. Follow the steps in order.

Need a server or a domain before you start? See the Server and Domain Setup appendix.

Step 1 — Build the Web Admin​

pnpm build --filter=web-admin
# or the shortcut
pnpm build:web-admin

mars build --platform web-admin runs the same workspace build.

Serve it in a container​

To build and serve the result inside a container instead of on the host:

mars build --platform web-admin --docker

In the compose stack the container is internal-only; the edge nginx publishes the app on port ${NGINX_HOST_PORT:-80} (80 by default). The dev server still uses 8807. See Docker for the Dockerfile variants, the edge nginx proxy and the NPM_REGISTRY build argument that matters on a slow network.

Step 2 — Build and run the API in a container​

The CLI builds the image from source and runs it:

mars build --platform api --docker

The equivalent compose invocation compiles inside the image and needs no host JDK or Maven:

docker compose -f docker-compose.build.yml up -d

Both publish port 8817:8817 and expect MySQL and Redis to already be running — start them with docker compose -f docker-compose.infra.yml up -d (see Environment Setup). The Docker page covers the Dockerfile variants, .env build arguments (MAVEN_MIRROR_URL) and the base-image pins that matter on a slow network or an older Docker daemon.

Next​

For workspace-wide mars dev, mars build and mars clean, see Start a Project. The Docker reference has the full container workflow.