Skip to content

Commit

Permalink
prometheus is configured for development
Browse files Browse the repository at this point in the history
  • Loading branch information
dmdequin committed Oct 18, 2023
1 parent 6f1a837 commit b4e3334
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Automated testing and linting was configured using GitHub Actions. This is compl
## App in Development

The app in development can be run locally for testing. To do so:
- Go to line 37 in the docker-compose-deploy.yml file and change the port mapping for the proxy to 8000:8000 (it is currently set to 80:8000).
- Go to line 60 in the docker-compose-deploy.yml file and change the port mapping for the proxy to 8000:8000 (it is currently set to 80:8000).
- Enter the proxy directory and run ```docker build .``` to build the docker image there.
- Go back to the main directory and run ```docker-compose -f docker-compose-deploy.yml up``` to run the application.
- In the browser go to [http://127.0.0.1:8000/api/docs](http://127.0.0.1:8000/api/docs) and test out the various endpoints using the Swagger documentation page.
Expand All @@ -63,3 +63,7 @@ The app in development can be run locally for testing. To do so:
The app is hosted on an AWS EC2 instance. The frontend search of the API can be found at [http://ec2-34-239-104-90.compute-1.amazonaws.com/api/msisd/home/](http://ec2-34-239-104-90.compute-1.amazonaws.com/api/msisd/home/).

The documentation can be found at [http://ec2-34-239-104-90.compute-1.amazonaws.com/api/docs/](http://ec2-34-239-104-90.compute-1.amazonaws.com/api/docs/). The documentation shows the endpoints available and the actions possible at each endpoint (GET, POST, etc). It is also possible to test out the functionality of each endpoint using the documentation page.

## Test the deployment version locally

todo: env file, instructions
2 changes: 1 addition & 1 deletion app/msisd/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h1>MSISD API</h1>
<nav class='navbar navbar-expand-lg bg-light'>
<ul>
<!-- change link based on deployed vs local version -->
<a href="http://localhost:8000/api/msisd/home/">Home</a>
<a href="http://ec2-34-239-104-90.compute-1.amazonaws.com/api/msisd/home/">Home</a>
</ul>
</nav>
<br>
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ services:

prometheus:
container_name: prometheus
image: prom/prometheus
image: prom/prometheus:latest
volumes:
- ./prometheus:/etc/prometheus
ports:
Expand All @@ -57,7 +57,7 @@ services:
depends_on:
- app
ports:
- 8000:8000
- 80:8000
volumes:
- static-data:/vol/static
networks:
Expand Down
4 changes: 2 additions & 2 deletions proxy/default.conf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

server {
{* port server will listen on *}
listen ${LISTEN_PORT};
listen ${LISTEN_PORT};

{* map /static url to /vol/static in system *}
location /static {
Expand All @@ -12,8 +12,8 @@ server {
{* map the rest of the urls *}
location / {
uwsgi_pass ${APP_HOST}:${APP_PORT};
{* uwsgi_pass http://127.0.0.1:8000;*}
include /etc/nginx/uwsgi_params;
client_max_body_size 10M;
{* proxy_pass http://app:8000; *}
}
}

0 comments on commit b4e3334

Please sign in to comment.