Skip to content

Commit 421b82c

Browse files
committed
add local-infra.yml to speed up start time for local development. add quickstart docs
1 parent 2577472 commit 421b82c

File tree

2 files changed

+45
-3
lines changed

2 files changed

+45
-3
lines changed

README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,23 @@ Environment based configuration using [Dotenv](https://www.npmjs.com/package/dot
1313

1414
Integration Testing with [SuperTest](https://github.com/visionmedia/supertest)
1515

16+
## Quickstart
17+
```
18+
npm install -g yarn
19+
yarn install
20+
# install docker https://docs.docker.com/install/
21+
docker stack deploy -c local-infra.yml infra
22+
# connect to postgres via postgres:password@localhost:5432
23+
# create 'seed' user with password 'password'
24+
# create 'seed' database and set the 'seed' user as the owner
25+
# updated
26+
cp .env.example .env
27+
yarn run start
28+
# wait for app to start
29+
yarn global add sequelize-cli
30+
sequelize db:seed:all
31+
```
32+
1633
## Environment Setup
1734
This project uses the [Dotenv](https://www.npmjs.com/package/dotenv) library to load sensitive data such
1835
as database passwords and client secrets.
@@ -21,10 +38,10 @@ There is a `.env.example` file included at the root of this project as an exampl
2138
for your project.
2239

2340
### RabbitMQ
24-
Install and run [RabbitMQ](https://www.rabbitmq.com/) with the default settings
41+
Install and run [RabbitMQ](https://www.rabbitmq.com/) with the default settings (or use the provided local-infra.yml in conjunction with docker-compose/swarm)
2542

2643
### Database
27-
You will need a [PostgreSQL](https://www.postgresql.org) database running on localhost:5432
44+
You will need a [PostgreSQL](https://www.postgresql.org) database running on localhost:5432 (or use the provided local-infra.yml in conjunction with docker-compose/swarm)
2845

2946
The setup of PostgreSQL is beyond the scope of this guide. Please reference the [Install Guides](https://wiki.postgresql.org/wiki/Detailed_installation_guides)
3047
for help installing PostgreSQL on your machine.
@@ -43,7 +60,7 @@ You can also run the app in debug mode and attach a [Debugger](https://www.jetbr
4360
Once the app is running and the tables are created, you can seed the database with the sequelize-cli.
4461
Install the sequelize-cli by running
4562

46-
yarn install --g sequelize-cli
63+
yarn global add sequelize-cli
4764
4865
then run
4966

local-infra.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: '3.4'
2+
3+
services:
4+
5+
db:
6+
image: postgres
7+
ports:
8+
- 5432:5432
9+
environment:
10+
POSTGRES_PASSWORD: password
11+
PGDATA: /var/lib/postgresql/data/pgdata
12+
volumes:
13+
- pg-data:/var/lib/postgresql/data/pgdata
14+
15+
rabbitmq:
16+
image: rabbitmq
17+
ports:
18+
- 5672:5672
19+
- 8080:15672
20+
volumes:
21+
- rabbit-data:/var/lib/rabbitmq
22+
23+
volumes:
24+
pg-data:
25+
rabbit-data:

0 commit comments

Comments
 (0)