# dl-family_locker

* Run MongoDB, RabbitMQ and Redis in docker

* The project can used in development environment

* **Do not use in production environment**

## Prerequisites

* [docker](https://docs.docker.com/install/)
* [docker-compose](https://docs.docker.com/compose/install/)
* [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git/)

## Installing
1.) Retrieve an authentication token and authenticate your Docker client to your registry.Use the AWS CLI:
```shell
aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin 816586121361.dkr.ecr.ap-south-1.amazonaws.com
```
git clone the project

```shell
git clone https://openforge.gov.in/plugins/git/digitallocker/family_locker_api.git
```
## RabbitMQ Management Plugin


* There is a second set of tags provided with the management plugin installed and enabled by default, 
* which is available on the standard management port of 15672, with the default 

* username and password of guest / guest:
```
$ docker run -dit --name local-rabbit -p 5672:5672 -p 15672:15672 rabbitmq:3.9-management
```
* You can then go to http://localhost:8030 or http://host-ip:8030 in a browser.



## Running

```shell

cd family_locker
rename .env_sample file to .env

#BASE Image

docker build . -f Dockerfile-family-locker-base -t dl-family-locker-api:base
docker tag dl-family-locker-api:base 816586121361.dkr.ecr.ap-south-1.amazonaws.com/dl-family-locker-api:base
docker push 816586121361.dkr.ecr.ap-south-1.amazonaws.com/dl-family-locker-api:base

#LOCAL Image
docker stop dl-family-locker-py
docker rm dl-family-locker-py

docker build . -f Dockerfile-family-locker-local -t dl-family-locker-py:local
docker run -dit -p 8080:80 -v E:/Project/Docker/family_locker_api/src_code:/opt/family-locker-py --name dl-family-locker-py dl-family-locker-py:local

docker run -dit -p 8081:81 -v D:\family_locker_api\src_code:/opt/family-locker-py --name dl-family-locker-beta dl-family-locker-py:beta



#run without volume mount 
docker run -dit -p 8080:80 --name dl-family-locker-py dl-family-locker-api:beta
#run with volume mount
docker run -dit -p 8080:8080 -v E:/Project/Docker/family_locker_api/src_code:/opt/family-locker-py --name dl-family-locker-api dl-family-locker-api:beta

docker run -dit -v D:\docker_testing\development_accounts_rmq_workers\src_code\rmq-worker:/opt/rmq-workers --name accounts_worker accounts/mongo-split-worker:file


docker network connect diginetwork dl-family-locker-api
docker network connect diginetwork accounts-nominee-local



#PROD Image

#BETA Image

docker build . -f Dockerfile-family-locker-beta -t dl-family-locker-api:beta
docker tag dl-family-locker-api:beta 816586121361.dkr.ecr.ap-south-1.amazonaws.com/dl-family-locker-api:beta
docker push 816586121361.dkr.ecr.ap-south-1.amazonaws.com/dl-family-locker-api:beta
```
## License

This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/techial1042/docker-mysql-mongo-redis/blob/master/LICENSE) file for details.

#commands 
docker build . -f Dockerfile-accounts-nominee-base -t accounts-nominee-base:base 
docker build . -f Dockerfile-accounts-nominee-local -t accounts-nominee-local:local 
docker run -dit -p 8080:80 -v D:\family_locker_api\src_code:/opt/accounts-nominee --name accounts-nominee-local accounts-nominee-local:local  
docker network connect diginetwork accounts-nominee-local 