Skip to content

Commit a194e4e

Browse files
committed
enhancement/ Add some notes on Readme
* Add some notes to README to improve the experience about running locally: * redis local conf * how to run with docker-compose
1 parent 0b047df commit a194e4e

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

README.md

+12-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ This project includes the boilerplate for a basic rest-api made in Node.JS with
1111
5. `cp .example.env.test .env.test`
1212
6. Create your DB (i.e. psql for Postgres: `psql -U <user> -h <host> -c "create database <db name>;"`) with same name as your .env file.
1313
7. Run `ENV=[dev, test, prod] yarn db:setup`.
14-
8. Start your server with `ENV=[dev, prod] yarn dev`.
14+
8. Check Redis notes conf for running local.
15+
9. Start your server with `ENV=[dev, prod] yarn dev`.
1516

1617
## Some scripts
1718

@@ -58,18 +59,23 @@ Also, for configuring the SonarQube keys you can follow the next [steps](https:/
5859
## Running with Docker
5960

6061
### Prerequisites
61-
In order to run the app with Docker, you should install or update to the latest version, we recommend to install [Docker-Desktop](https://docs.docker.com/get-docker/) due to composer and some cool CLI-UI tools are included.
62+
* In order to run the app with Docker, you should install or update to the latest version, we recommend to install [Docker-Desktop](https://docs.docker.com/get-docker/) due to composer and some cool CLI-UI tools are included.
63+
* If you're running it local, don't forget to change REDIS_HOST to localhost into the .env.dev file.
6264

6365
### Development with Docker
64-
6566
The following commands will build and run all you need to start working on the base, without any other installation requirements. Important: if you already have postgres running locally, you'll need to kill the service before run `docker-compose up`.
6667

6768
```
6869
docker-compose --env-file .env.dev build
6970
```
7071

7172
```
72-
docker-compose --env-file .env.dev up
73+
docker-compose --env-file .env.dev up -d --no-recreate
74+
```
75+
76+
if you only want to run redis and postgres and debug local:
77+
```
78+
docker-compose --env-file .env.dev up -d --no-recreate postgres redis
7379
```
7480

7581
### Deployment with Docker (only for production)
@@ -89,7 +95,7 @@ docker run --rm --env-file=.env.prod -p 3000:3000 --name node-api node-ts-api-ba
8995
```
9096

9197
### Fix issue at build docker image (dependencies to install bcrypt are not providede in alpine version of node)
92-
98+
9399
Add the following line before the command ` RUN yarn ` in the Dockerfile.
94100

95101
```
@@ -153,7 +159,7 @@ This is the suggested scaffolding for this project. You can take a look at:
153159
- [tsconfig-paths](https://github.com/dividab/tsconfig-paths#readme) - Utility to register relative paths set at tsconfig file
154160
- [express-rate-limit](https://github.com/nfriedly/express-rate-limit) - Basic rate-limiting middleware used to limit repeated requests to public APIs
155161
- [morgan](https://github.com/expressjs/morgan) - HTTP request logger middleware for node.js
156-
- [nodemailer](github.com/nodemailer/nodemailer) - Module for Node.js to allow the easy email sending.
162+
- [nodemailer](github.com/nodemailer/nodemailer) - Module for Node.js to allow the easy email sending.
157163

158164
## Code Quality
159165

0 commit comments

Comments
 (0)