Skip to content

Commit

Permalink
Merge pull request #20 from prathambatra/master
Browse files Browse the repository at this point in the history
Updated README
  • Loading branch information
jatinkatyal13 authored May 24, 2020
2 parents f273722 + b5d3c52 commit 033cec7
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
host=192.168.0.237
host=rabbitmq
login=test
password=test
port=5672
Expand Down
14 changes: 11 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
version: '3'
services:
worker:
build: .
restart: on-failure:5
rabbitmq:
image: rabbitmq:3-management-alpine
environment:
- RABBITMQ_DEFAULT_USER=test
- RABBITMQ_DEFAULT_PASS=test
ports:
- "5672:5672"
- "15672:15672"
worker:
build: .
depends_on:
- rabbitmq
restart: on-failure
env_file:
- .env
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"author": "abhishek97",
"license": "MIT",
"scripts": {
"start": "node src/index.js"
"start": "node src/index.js",
"test": "node src/test.js"
},
"dependencies": {
"amqp": "^0.2.7",
Expand Down
28 changes: 24 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
## How to Build
## Certificate Worker
This service is used to generate a certificate-pdf for given student data. It works on amqp protocol on rabbitmq-server and uses amoeba-certificate as consumer.

- Build Docker Image: `docker build -t certificate-worker .`
- Run a Container from the image: `docker run -t -d --env-file .env certificate-worker`
- sh into the container: `docker exec -it <container-id> /bin/sh`
## Setup
This project can be setup locally as well as on docker.

## Setup locally
* Firstly download and install rabbitmq-server on your system. [See here](https://www.rabbitmq.com/download.html)
* Create .env
* Make sure rabbitmq-server is running (default port 5672)
* Start server.
```
npm start
```
* For testing.
```
npm test
```

## Setup on docker
* Create .env
* Run all services on docker
```
docker-compose up
```

0 comments on commit 033cec7

Please sign in to comment.