# Deploy
## Setup
### sol-mem-gen
* Clone the repo:
```bash
git clone git@git.vdb.to:deep-stack/sol-mem-gen.git
cd sol-mem-gen/deploy
```
* Build registry CLI image:
```bash
docker build -t cerc/laconic-registry-cli .
# Builds image cerc/laconic-registry-cli:latest
```
* Configure `userKey` and `bondId` in the registry CLI config:
```bash
nano config.yml
```
* Add configuration for registry operations:
```bash
cp .registry.env.example .registry.env
# Fill in the required values
nano .registry.env
```
* Add configuration for the app:
```bash
curl -s https://git.vdb.to/deep-stack/sol-mem-gen/raw/branch/main/.env.example -o .app.env
# Fill in the required values
nano .app.env
```
### sol-token-locker
* Create a dir for `sol-token-locker` deployment:
```bash
# In deployments dir
mkdir sol-token-locker
cd sol-token-locker
```
* Follow [instructions](https://git.vdb.to/deep-stack/sol-token-locker/src/branch/main/stack-orchestrator/stacks/sol-token-locker/README.md) to setup the `sol-token-locker` stack in `sol-token-locker` directory
## Run
### sol-mem-gen
* Update configuration for the app as required:
```bash
# In sol-mem-gen/deploy dir
nano sol-mem-gen/.app.env
```
* Deploy `sol-mem-gen` App:
```bash
# In sol-mem-gen/deploy dir
docker run -it \
-v ./:/app/deploy -w /app/deploy \
-e DEPLOYMENT_DNS=memes.markto.market \
cerc/laconic-registry-cli:latest \
./deploy.sh
```
* Check deployment logs on deployer UI:
* Visit deployed app:
* To redeploy the app (using `main` branch), repeat the previous steps
### sol-token-locker
* Update configuration for token locker as required:
```bash
# In deployments dir
cd sol-token-locker
nano sol-token-locker-deployment/config.env
```
* [Config reference](https://git.vdb.to/deep-stack/sol-token-locker/src/branch/main/stack-orchestrator/stacks/sol-token-locker/README.md#configuration)
* Start the deployment:
```bash
laconic-so deployment --dir sol-token-locker-deployment start
```
* Follow logs:
```bash
laconic-so deployment --dir sol-token-locker-deployment logs sol-token-locker -f
```
* For updating the deployment:
```bash
# Stop the deployment
laconic-so deployment --dir sol-token-locker-deployment stop
# Update the config as required
nano sol-token-locker-deployment/config.env
# Re-start deployment
laconic-so deployment --dir sol-token-locker-deployment start
```