Local projects
Run complete Spica projects on your machine with Docker, on MongoDB or PostgreSQL, and upgrade or remove them.
spica project runs a complete Spica instance in Docker: the API, the panel, a database and an nginx ingress that serves both on one port.
Start a project
spica project start my-app✔ Pulling images (4/4)
✔ Creating a network named my-app-network.
✔ Creating database containers (1/1)
✔ Waiting for the replica set to become ready.
✔ Creating spica containers (2/2)
✔ Creating an ingress to route traffic.
Spica my-app is serving on http://localhost:4500.
Open your browser on http://localhost:4500/dashboard to login.
Identitifer: spica
Password: spica| Option | Default | Description |
|---|---|---|
--image-version | latest | Spica version to run, for example 0.22.1. |
-p, --port | 4500 | Port of the ingress. A free port is picked when it is taken. |
--database-type | mongodb | mongodb or postgresql. |
--database-replicas | 1 | MongoDB replica set members. PostgreSQL runs one node. |
--mongo-version | 8.0 | MongoDB image tag. |
--postgres-version | 18 | PostgreSQL image tag. |
--api-options | Path to a JSON file with extra API options. | |
-o, --open | Open the panel when ready. | |
-f, --force | Replace a project with the same name. | |
--retain-volumes | true | With --force, keep the existing data. |
--restart | true | Restart containers that exit unexpectedly. |
--image-pull-policy | if-not-present | default pulls images every time. |
--local-resource-folder | Mount a folder that the API keeps in two-way sync with its resources. |
What runs
| Container | Image | Role |
|---|---|---|
<name>-ingress | nginx | Serves the panel at / and the API at /api on the chosen port. |
<name>-spica | spicaengine/panel | Admin panel. |
<name>-api | spicaengine/api | API. |
<name>-db-0 | mongo or spicaengine/postgres | Database. Data is kept in a Docker volume. |
The API is started with --public-url=http://localhost:<port>/api, a master key equal to the project name and --persistent-path=/var/data.
Extra API options
Put options in a JSON file, keyed by option name without dashes:
{
"bucket-graphql": true,
"function-timeout": 120,
"passport-default-identity-password": "a-better-password"
}spica project start my-app --api-options $(pwd)/api-options.jsonOptions that the CLI sets itself (database, public URL, master key and persistent path) can't be overridden this way.
List projects
spica project lsShows each project's namespace, status, version and port.
Upgrade
spica project upgrade my-app 0.22.1Replaces the API and panel containers with the given version and keeps your data.
Remove
spica project remove my-appStops and removes the containers and network. Data volumes are kept unless you pass --retain-volumes=false.