
# Automated procedure

[[deploy-configurator script]]

# Manual procedure

1. Copy the source to mini (run on this machine):

``` bash
rsync -av --delete --exclude .git --exclude node_modules --exclude dist --exclude data --exclude .env --exclude example-proxy-file /home/pygenot/Work/Apps/productConfigurator/ mini:/Users/pierre-yvesgenot/Docker/configurator/
```

2. Create the settings (on mini, after ssh mini):

``` bash
cd ~/Docker/configurator
cp .env.example .env
sed -i '' "s|^AUTH_SECRET=$|AUTH_SECRET=$(openssl rand -base64 32)|" .env
nano .env
```
In the editor, uncomment and set PUBLIC_HOST (the host name, for example configurator.mirukuchan.com) and LETSENCRYPT_EMAIL. Set SMTP_URL and MAIL_FROM too if you have a mail server; without them, invitations are only printed to the container log.

3. Point DNS at mini. The host name in PUBLIC_HOST must resolve to mini's public address before you start, or the certificate cannot be issued.

4. Build and start:
``` bash
docker compose -f compose.proxy.yaml up -d --build
```
The first build takes a few minutes, mostly downloading Chromium.

5. Create the first Admin:
``` bash
docker exec configurator node_modules/.bin/tsx src/server/create-admin.ts you@example.com Your Name
```
It prints an https://<PUBLIC_HOST>/#/set-password… link to choose your password.

6. Check: docker ps should show configurator as healthy after about 30 seconds, and docker logs nginx-proxy-acme shows the certificate being issued.

To update later, repeat steps 1 and 4. The rsync leaves .env on mini untouched, and the data stays in the configurator-data volume.