Skip to content

Commit

Permalink
Adding README, new build.sh script, increasing version
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiobogossian committed Jun 9, 2020
1 parent c5ed7ba commit d95cc8f
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 29 deletions.
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
# Forest Monitor Server - Brazil Data Cube
# Forest Monitor BackEnd Server

## Publishing on DockerHub

To publish a new image to DockerHub, that the application version at forest_monitor/setup.py was increased.

### Building with Docker

To build and push an image to Docker Hub, just run:

$ Docker/docker-build.sh

## Running locally

### Dependencies

To run the application locally, be sure too to install the following dependencies:

.. code-block:: shell
$ apt-get update
$ apt-get install -y build-essential libpq-dev python3-pip git
$ pip3 install -r requirements.txt

### Running

To run the application:

.. code-block:: shell
$ python3 Docker/manage.py run

TODO
19 changes: 0 additions & 19 deletions build.sh

This file was deleted.

9 changes: 9 additions & 0 deletions docker-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ubuntu:18.04

ADD . /forest-monitor-backend-base

WORKDIR /forest-monitor-backend-base

VOLUME /data

#CMD /bin/bash
File renamed without changes.
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ services:
- SQLALCHEMY_DATABASE_URI=postgresql+psycopg2://postgres:postgres@localhost/test
- CLIENT_SECRET_KEY="CHANGE_ME"
- CLIENT_AUDIENCE="CHANGE_ME"
- MASK_TABLE_DETER="mascara_deter",
- MASK_TABLE_PRODES="mascara_prodes",
- DESTINATION_TABLE="deter"
ports:
- "5016:5000"
restart: unless-stopped
8 changes: 2 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
FROM brazildatacube/base:0.1

RUN apt-get update && apt-get install -y build-essential libpq-dev
FROM forestmonitor/forest-monitor-backend-base:1.0

ADD . /forest-monitor

WORKDIR /forest-monitor

RUN pip3 install -r requirements.txt

VOLUME /data

CMD [ "python3", "manage.py", "run" ]
CMD [ "python3", "manage.py", "run" ]
11 changes: 11 additions & 0 deletions docker/docker-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

PROJECT="forestmonitor"

REPOSITORY="forest-monitor-backend"

VERSION=$(grep version ../setup.py | head -1 | sed 's/.*"\(.*\)".*/\1/')

docker build -t $PROJECT/$REPOSITORY:v$VERSION -f Dockerfile .

docker push $PROJECT/$REPOSITORY:v$VERSION
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

setup(
name='Forest-Monitor',
version='0.0.1',
version="1.1.0",
description='Forest Monitor Package',
author='Admin',
author_email='[email protected]',
license="MIT",
packages=find_packages(),
url='https://github.com/raphaelrpl/forest-monitor',
)
)

0 comments on commit d95cc8f

Please sign in to comment.