Install with Docker
Run the official LessCode image with a volume that keeps your flow.
The official image is totalplatform/lesscode. Inside the container, LessCode reads and saves its flow in the folder /www/.src/flowstreams. The image does not include a flow, so you put the default flow file into a volume on that folder once. Until you do, the designer shows a spinner and does not load.
Run with Docker
1. Get the default flow file from the source code:
git clone https://github.com/totaljs/lesscode.git2. Start the container with a volume for the flow:
docker run -d --name lesscode -p 8000:8000 -v lesscode-flows:/www/.src/flowstreams totalplatform/lesscode3. Copy the flow file into the volume and restart the container:
docker cp lesscode/flowstreams/lesscode.flow lesscode:/www/.src/flowstreams/lesscode.flow
docker restart lesscode4. Open http://localhost:8000/. See First access.
The volume lesscode-flows keeps your flow when you remove and create the container again. Always start new containers with the same -v lesscode-flows:/www/.src/flowstreams option.
Run with Docker Compose
1. Create a docker-compose.yaml file:
services:
lesscode:
image: totalplatform/lesscode
container_name: lesscode
ports:
- "8000:8000"
volumes:
- flowstreams:/www/.src/flowstreams
volumes:
flowstreams:2. Start it:
docker compose up -d3. Copy the default flow file into the volume (from a clone of the source code, as above) and restart:
docker compose cp lesscode/flowstreams/lesscode.flow lesscode:/www/.src/flowstreams/lesscode.flow
docker compose restartdocker compose down followed by docker compose up -d keeps your flow, because it stays in the flowstreams volume.
The docker-compose.yaml file in the source code mounts /www/flowstreams. LessCode does not save to that folder, so use the volume shown above instead.
Before you stop a container
LessCode writes changes to the flow file a few seconds after you make them. Wait a few seconds after your last change before you stop or remove the container.
To keep a copy of your flow outside Docker, see Back up your flow.