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

Terminal
spica project start my-app
Text
✔ 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
OptionDefaultDescription
--image-versionlatestSpica version to run, for example 0.22.1.
-p, --port4500Port of the ingress. A free port is picked when it is taken.
--database-typemongodbmongodb or postgresql.
--database-replicas1MongoDB replica set members. PostgreSQL runs one node.
--mongo-version8.0MongoDB image tag.
--postgres-version18PostgreSQL image tag.
--api-optionsPath to a JSON file with extra API options.
-o, --openOpen the panel when ready.
-f, --forceReplace a project with the same name.
--retain-volumestrueWith --force, keep the existing data.
--restarttrueRestart containers that exit unexpectedly.
--image-pull-policyif-not-presentdefault pulls images every time.
--local-resource-folderMount a folder that the API keeps in two-way sync with its resources.

What runs

ContainerImageRole
<name>-ingressnginxServes the panel at / and the API at /api on the chosen port.
<name>-spicaspicaengine/panelAdmin panel.
<name>-apispicaengine/apiAPI.
<name>-db-0mongo or spicaengine/postgresDatabase. 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:

api-options.json
{
  "bucket-graphql": true,
  "function-timeout": 120,
  "passport-default-identity-password": "a-better-password"
}
Terminal
spica project start my-app --api-options $(pwd)/api-options.json

Options that the CLI sets itself (database, public URL, master key and persistent path) can't be overridden this way.

List projects

Terminal
spica project ls

Shows each project's namespace, status, version and port.

Upgrade

Terminal
spica project upgrade my-app 0.22.1

Replaces the API and panel containers with the given version and keeps your data.

Remove

Terminal
spica project remove my-app

Stops and removes the containers and network. Data volumes are kept unless you pass --retain-volumes=false.