Install MemCP with Docker: Difference between revisions

From MemCP
Jump to navigation Jump to search
(Created page with "To build the image the first time: git clone https://github.com/launix-de/memcp cd memcp docker build . -t memcp For app development and to enter the Scheme console: mkdir data docker run -v data:/data -it -p 4321:4321 -p 3307:3307 memcp To run your custom Scheme apps (like the one from RDF templating and model driven development): make data docker run -e PARAMS="lib/main.scm apps/minigame.scm" -v data:/data -it -p 4321:4321 -p 3307:3307 memcp During productio...")
 
(Refresh MemCP documentation: accuracy, operational guidance, performance profile and maintained API reference)
Line 1: Line 1:
To build the image the first time:
<!-- Copyright (C) 2026 Carl-Philip Haensch -->
git clone https://github.com/launix-de/memcp
 
cd memcp
<!-- SPDX-License-Identifier: GPL-3.0-or-later -->
docker build . -t memcp
 
For app development and to enter the Scheme console:
<span id="install-memcp-with-docker"></span>
mkdir data
= Install MemCP with Docker =
docker run -v data:/data -it -p 4321:4321 -p 3307:3307 memcp
 
To run your custom Scheme apps (like the one from [[RDF templating and model driven development]]):
<syntaxhighlight lang="bash">docker pull carli2/memcp:latest
make data
docker volume create memcp_data
docker run -e PARAMS="lib/main.scm apps/minigame.scm" -v data:/data -it -p 4321:4321 -p 3307:3307 memcp
docker run -d --name memcp --restart unless-stopped \
During production without Scheme console and with a service model and a global data store:
  -e ROOT_PASSWORD='replace-with-a-strong-password' \
mkdir /var/memcp
  -v memcp_data:/data -p 4321:4321 -p 3307:3307 \
docker run -v /var/memcp:/data -di -p 4321:4321 -p 3307:3307 --restart unless-stopped memcp
  carli2/memcp:latest</syntaxhighlight>
<code>ROOT_PASSWORD</code> is used only for a fresh <code>/data</code>. The image runs with <code>--no-repl</code>, persists under <code>/data</code>, and forwards stop signals to MemCP. Pin a release tag in production instead of <code>latest</code>. Do not publish either port to an untrusted network without firewall/reverse-proxy protection.
 
Pass additional flags through <code>PARAMS</code>, for example <code>-e PARAMS='--disable-mysql --api-port=4321'</code>. <code>APP</code> selects the Scheme entry file and defaults to <code>lib/main.scm</code>.
 
Back up the volume before upgrading. Verify the container log, authenticate a query, restart the container, and verify persisted data after every upgrade.
 
== Build and application development ==
 
To test the image produced by the current checkout instead of the published image:
 
<syntaxhighlight lang="bash">git clone https://github.com/launix-de/memcp.git
cd memcp
docker build -t memcp-local .
docker volume create memcp_dev_data
docker run --rm -it \
  -e ROOT_PASSWORD='development-password' \
  -v memcp_dev_data:/data -p 4321:4321 -p 3307:3307 \
  memcp-local</syntaxhighlight>
 
Interactive mode is useful for Scheme application development; production containers should remain detached and use <code>--no-repl</code>. To load another Scheme entrypoint, mount or bake the application into the image and select it with <code>APP</code>. Use <code>PARAMS</code> only for command-line flags, not as a replacement for the application filename.
 
Bind mounts such as <code>-v /var/lib/memcp:/data</code> are also supported. Ensure the container user can write the directory and include it in backup and restore procedures.

Revision as of 11:59, 28 August 2026


Install MemCP with Docker

<syntaxhighlight lang="bash">docker pull carli2/memcp:latest docker volume create memcp_data docker run -d --name memcp --restart unless-stopped \

 -e ROOT_PASSWORD='replace-with-a-strong-password' \
 -v memcp_data:/data -p 4321:4321 -p 3307:3307 \
 carli2/memcp:latest</syntaxhighlight>

ROOT_PASSWORD is used only for a fresh /data. The image runs with --no-repl, persists under /data, and forwards stop signals to MemCP. Pin a release tag in production instead of latest. Do not publish either port to an untrusted network without firewall/reverse-proxy protection.

Pass additional flags through PARAMS, for example -e PARAMS='--disable-mysql --api-port=4321'. APP selects the Scheme entry file and defaults to lib/main.scm.

Back up the volume before upgrading. Verify the container log, authenticate a query, restart the container, and verify persisted data after every upgrade.

Build and application development

To test the image produced by the current checkout instead of the published image:

<syntaxhighlight lang="bash">git clone https://github.com/launix-de/memcp.git cd memcp docker build -t memcp-local . docker volume create memcp_dev_data docker run --rm -it \

 -e ROOT_PASSWORD='development-password' \
 -v memcp_dev_data:/data -p 4321:4321 -p 3307:3307 \
 memcp-local</syntaxhighlight>

Interactive mode is useful for Scheme application development; production containers should remain detached and use --no-repl. To load another Scheme entrypoint, mount or bake the application into the image and select it with APP. Use PARAMS only for command-line flags, not as a replacement for the application filename.

Bind mounts such as -v /var/lib/memcp:/data are also supported. Ensure the container user can write the directory and include it in backup and restore procedures.