Skip to content

Commit 1545d50

Browse files
committed
chore: improve readme for local development
1 parent 16fbdee commit 1545d50

3 files changed

Lines changed: 23 additions & 18 deletions

File tree

.env.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ BASE_URL=http://localhost:3000
44
PORT=3000
55

66
DATABASE_HOST=127.0.0.1
7-
DATABASE_USERNAME=rdoc
7+
DATABASE_USERNAME=root
88
DATABASE_PASSWORD=password
99
DATABASE_NAME=rdocs
1010
DATABASE_PORT=3306

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,27 @@ You'll need docker and docker-compose to run this stack locally
2626

2727
- Copy the .env.sample to .env and change relevant variables
2828
- If you already have a mysql db running on port 3306, update the `DATABASE_PORT` to another value as well as the port mapping in docker-compose.yml (e.g. change it to `"3308:3306"`)
29-
- `docker-compose create` to create the redis and mysql container
29+
- Make sure you are using version 2 of docker-compose, then run `docker-compose create` to create the redis and mysql container
3030
- `docker-compose start` to fire up a local redis an mysql
3131
- Use the same node version in your terminal as the Dockerfile is using: `nvm use 8.16`
3232
- `npm install`
3333
- Run the database migrations by doing `npm run migrate`
3434
- `npm run start-dev`
3535

36-
Once the db is running, you can use a mysql client like dbeaver to access it. Connect to it based on the environment variables you have in `docker-compose.yml`. The server host should just be `localhost`.
36+
Once the db is running, you can use a mysql client like dbeaver to access it. Connect to it based on the environment variables you have in `docker-compose.yml`. You will also need to go in the "Driver properties" tab of the connection window, and set `allowPublicKeyRetrieval` to true. When you are done, click on Finish. The server host should just be `localhost`.
3737

3838
### Troubleshooting
3939

4040
If you get an error: `SequelizeConnectionError: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client`
4141
follow these steps:
4242

43-
1. Access your mysql container: you can do it either through the docker app by clicking on the "cli" button of the container, or in your terminal by running `docker exec -it <mysql_container_id> bash`
43+
1. Access your mysql container: you can do it either through the docker app by clicking on the "cli" button of the container, or in your terminal by running:
44+
- `docker ps` and grabing the container id for mysql
45+
- `docker exec -it <mysql_container_id> bash`
4446
2. `mysql -u root -p`
4547
3. Enter: `password`
46-
4. `ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'`
48+
4. `ALTER USER 'root' IDENTIFIED WITH mysql_native_password BY 'password';`
49+
5. `flush privileges;`
4750

4851
## How to deploy
4952

docker-compose.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
db:
2-
image: mysql:latest
3-
ports:
4-
- "3306:3306"
5-
environment:
6-
MYSQL_ROOT_PASSWORD: password
7-
MYSQL_USER: rdoc
8-
MYSQL_PASSWORD: password
9-
MYSQL_DATABASE: rdocs
10-
redis:
11-
image: redis
12-
ports:
13-
- "6379:6379"
1+
version: "2"
2+
services:
3+
db:
4+
image: mysql:latest
5+
ports:
6+
- "3306:3306"
7+
environment:
8+
MYSQL_ROOT_PASSWORD: password
9+
MYSQL_USER: rdoc
10+
MYSQL_PASSWORD: password
11+
MYSQL_DATABASE: rdocs
12+
redis:
13+
image: redis
14+
ports:
15+
- "6379:6379"

0 commit comments

Comments
 (0)