Skip to content

Commit

Permalink
Updated readme, dockerfile and docker-compose file
Browse files Browse the repository at this point in the history
  • Loading branch information
emiteze committed Aug 2, 2017
1 parent 1831197 commit 2284ab9
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 9 deletions.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM maven

WORKDIR /code
ADD pom.xml /code/pom.xml
ADD src /code/src
RUN mvn dependency:resolve
RUN mvn clean install

EXPOSE 8080
CMD java -jar target/xy-inc-0.0.1-SNAPSHOT.jar
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
## Quick Start

> 1. Install [Compose](http://gradle.org/gradle-download/)
2. Clone this repository using ` git clone https://github.com/emiteze/xy-inc.git `
3. Execute the command ` docker-compose up ` in the root of the project
4. Open in your browser the URL ` http://localhost:8080/swagger-ui.html `
> 2. Clone this repository using ` git clone https://github.com/emiteze/xy-inc.git `
> 3. Execute the command ` docker-compose up ` in the root of the project
> 4. Open in your browser the URL ` http://localhost:8080/swagger-ui.html `
## Endpoints

Expand All @@ -19,16 +19,13 @@ Expected parameters:
UUID id, String name (both optional)
Example: /get-point?id=5cfd917e-d1c8-48cd-b0a2-072b137cb40a or /get-point?name=Churrascaria
If both are sent, the endpoint will use the id parameter in the query.

> 2. GET /get-points
Search for all Point Of Interest saved in the database and don't take any parameters.

> 3. GET /get-points-nearby
Search for a list of Point Of Interest given a location reference and a maximum distance that the backend will query given that reference.
Expected parameters:
int coordx, int coordy, double maxDistance (all three required)
Example: /get-points-nearby?coordx=15&coordy=15&maxDistance=10

> 4. POST /save-point
Saves a Point Of Interest in the database.
Expected parameter:
Expand All @@ -38,13 +35,11 @@ Point Of Interest object
"coordx": 10,
"coordy": 10
}

> 5. DELETE /delete-point
Delete a specific Point Of Interest if given "id" via query parameter or the object itself via body request, or a list of Point Of Interest if given "name" via query parameter.
Expected parameters:
UUID id, String name, Point Of Interest object
Example: /delete-point?id=5cfd917e-d1c8-48cd-b0a2-072b137cb40a or /delete-point?name="Churrascaria"

> 6. PUT /update-point
Update a specific Point Of Interest in the database passing the object with the new values.
Expeted parameter:
Expand All @@ -56,7 +51,6 @@ Point Of Interest object
"coordy": 10
}


## Technologies

> Backend
Expand Down
24 changes: 24 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: '2'
services:
mongo:
image: mongo:3.4.6
container_name: "mongodb"
environment:
- MONGO_DATA_DIR=/data/db
- MONGO_LOG_DIR=/dev/null
volumes:
- ./data/db:/data/db
ports:
- 27017:27017
command: mongod --smallfiles
back:
links:
- mongo
depends_on:
- mongo
container_name: "backend"
build:
context: .
dockerfile: Dockerfile
ports:
- 8080:8080

0 comments on commit 2284ab9

Please sign in to comment.