Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/fix local docker setup #34

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 33 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,47 @@ Dependencies on other Microservices:

## Getting Started

### OS X

**First, make sure that you have the [API gateway running
locally](https://github.com/control-tower/control-tower).**

We're using Docker which, luckily for you, means that getting the
application running locally should be fairly painless. First, make sure
that you have [Docker Compose](https://docs.docker.com/compose/install/)
installed on your machine.
Start by cloning the repository from github to your execution environment

```
git clone https://github.com/resource-watch/query
cd query
./query.sh develop
```text
git clone https://github.com/resource-watch/query.git && cd query
```

After that, follow one of the instructions below:

### Using native execution

1 - Set up your environment variables. See `dev.env.sample` for a list of variables you should set, which are described in detail in [this section](#environment-variables) of the documentation. Native execution will NOT load the `dev.env` file content, so you need to use another way to define those values

2 - Install node dependencies using yarn:
```
yarn
```

3 - Start the application server:
```
yarn start
```

The endpoints provided by this microservice should now be available through Control Tower's URL.

### Using Docker

1 - Create and complete your `dev.env` file with your configuration. You can find an example `dev.env.sample` file in the project root.

You can now access the microservice through the CT gateway.
2 - Execute the following command to run Control tower:

```
./query.sh develop
```

The endpoints provided by this microservice should now be available through Control Tower's URL.


You can now access the microservice through the API gateway.

### Configuration

Expand Down
8 changes: 5 additions & 3 deletions docker-compose-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ services:
develop:
build: .
ports:
- "35749:35729"
- "5001:5001"
environment:
PORT: 5001
NODE_PATH: app/src
CT_URL: http://mymachine:9000
LOCAL_URL: http://mymachine:5000
LOCAL_URL: http://mymachine:5001
API_VERSION: v1
CT_TOKEN: null
CT_TOKEN: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Im1pY3Jvc2VydmljZSIsImNyZWF0ZWRBdCI6IjIwMTYtMDktMTQifQ.IRCIRm1nfIQTfda_Wb6Pg-341zhV8soAgzw7dd5HxxQ

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ethanroday this is a local/test key that is used (and committed) across many of the repos.

CT_REGISTER_MODE: auto
GCLOUD_STORAGE: ${GCLOUD_STORAGE}
GOOGLE_APPLICATION_CREDENTIALS: /opt/query/storage.json
Expand Down