2021-02-12 10:48:08 +00:00
|
|
|
|
|
|
|
|
<div align="center">
|
2021-02-12 10:52:10 +00:00
|
|
|
<a href="https://bullish.codingcoffee.me" target="_blank" rel="noopener noreferrer">
|
|
|
|
|
<img src="./frontend/src/assets/logo.png" width="250">
|
|
|
|
|
<h1>
|
|
|
|
|
Bullish
|
|
|
|
|
</h1>
|
|
|
|
|
<h4>A simple webapp to explore Bhav Copy Equity data</h4>
|
|
|
|
|
</a>
|
2021-02-12 10:48:08 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
[](https://www.gnu.org/licenses/agpl-3.0)
|
|
|
|
|
|
|
|
|
|
Backend:
|
|
|
|
|
[](https://hub.docker.com/r/codingcoffee/bullish-backend)
|
|
|
|
|
[](https://hub.docker.com/r/codingcoffee/bullish-backend/tags?name=latest)
|
|
|
|
|
|
|
|
|
|
Frontend
|
|
|
|
|
[](https://hub.docker.com/r/codingcoffee/bullish-frontend)
|
|
|
|
|
[](https://hub.docker.com/r/codingcoffee/bullish-frontend/tags?name=latest)
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
|
|
- Local setup is supported via Docker Compose
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
docker-compose up -d
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Build
|
|
|
|
|
|
|
|
|
|
- Build images for dev
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
docker-compose build
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
- Build images for prod
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
./prod-build.sh
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Logging
|
|
|
|
|
|
|
|
|
|
To get the logs of all containers
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
docker logs -f
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
To get the logs of a particular container
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
docker logs -f container-name
|
|
|
|
|
```
|
|
|
|
|
Here `container-name` can be either of `backend`, `frontend`, `redis`,
|
|
|
|
|
`postgresql`, `rqworker` or `rqscheduler`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Deploy
|
|
|
|
|
|
2021-02-12 11:27:49 +00:00
|
|
|

|
|
|
|
|
|
|
|
|
|
|
2021-02-12 10:48:08 +00:00
|
|
|
The recommended way for deploy is on Kubernetes. You can find the related files
|
|
|
|
|
in `k8s` directory.
|
|
|
|
|
|
|
|
|
|
- One time deploy
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
# Deploy ingress
|
|
|
|
|
kubectl apply -f k8s/ingress/ingress-https.yaml
|
|
|
|
|
|
|
|
|
|
# Deploy Postgres and Redis DB
|
|
|
|
|
kubectl apply -f k8s/app/redis.yaml
|
|
|
|
|
kubectl apply -f k8s/app/postgres.yaml
|
|
|
|
|
|
|
|
|
|
# Deploy Backend
|
|
|
|
|
kubectl apply -f k8s/app/backend.yaml
|
|
|
|
|
kubectl apply -f k8s/app/rqworker.yaml
|
|
|
|
|
kubectl apply -f k8s/app/rqscheduler.yaml
|
|
|
|
|
|
|
|
|
|
# Deploy Frontend
|
|
|
|
|
kubectl apply -f k8s/app/frontend.yaml
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
- Subsequent deploys can be done by rolloing out a restart since all pods have a `imagePullPolicy` set to Always
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
# Push containers to Docker Hub and Deploy to K8s
|
|
|
|
|
./prod-deploy.sh
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
|
|
The code in this repository has been released under the [GNU Affero General Public License v3](https://www.gnu.org/licenses/agpl-3.0.en.html)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Attributions
|
|
|
|
|
|
|
|
|
|
- [Bullish icon](./.assets/images/bullish.png) made by [Freepik](https://www.freepik.com) from [Flaticon](https://www.flaticon.com)
|
|
|
|
|
|