Skip to content

Commit

Permalink
Merge pull request #2 from abriginets/feat/add-production-docker-compose
Browse files Browse the repository at this point in the history
feat: add production database config for clorie
  • Loading branch information
abriginets authored May 1, 2024
2 parents f5c32c5 + 7618d74 commit 15a8508
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,18 @@ $ node -v
```

And that's it! You are good to go 🎆

### Setting up production database

Before deploying your own Clorinde bot to production, you must first to create a MySQL database. To do so you should first generate a unique password for your production database by executing the following command:

```bash
$ chmod +x ./scripts/generate-prod-db-pass.sh
$ ./scripts/generate-prod-db-pass.sh
```

This will generate a password and put it into `docker/production/docker-compose.yml` for you. After that you can just `cd` into directory with this yaml and run

```bash
$ docker compose up -d
```
10 changes: 10 additions & 0 deletions docker/production/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3'

services:
mysql:
image: mysql:8.0.36
environment:
MYSQL_ROOT_PASSWORD: CHANGE ME
MYSQL_DATABASE: clorie
ports:
- '3306:3306'
7 changes: 7 additions & 0 deletions scripts/generate-prod-db-pass.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# Generate a random password
new_password=$(openssl rand -hex 16)

# Replace "CHANGE ME" with the generated password
sed -i "s/CHANGE ME/$new_password/g" ./docker/production/docker-compose.yml

0 comments on commit 15a8508

Please sign in to comment.