Skip to content

Commit

Permalink
Dockerfile and update documentation accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
heralden committed Mar 27, 2020
1 parent b63d2bc commit ab134b7
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 15 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM gcr.io/distroless/java:11
COPY target/bluegenes.jar /
WORKDIR /
EXPOSE 5000
CMD ["bluegenes.jar"]
22 changes: 19 additions & 3 deletions docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,26 @@ There is also a shortcut that in addition cleans and compiles CSS.

## Deploying your build

One of the easiest ways to deploy the prod minified version is to set up [Dokku](http://dokku.viewdocs.io/dokku/) on your intended server. You can also use BlueGenes with [heroku](https://www.heroku.com/).
### docker

BlueGenes has a Dockerfile which you can build with a fresh uberjar.

### Minified deployment using dokku
lein uberjar
docker build -t bluegenes .

Run it and the web server should default to port 5000.

docker run -p 5000:5000 -it --rm bluegenes

You can specify environment variables by using the `-e` or `--env-file` arguments when calling docker. See [Configuring](/docs/configuring.md) for a list of all available environment variables.

There is also a prebuilt docker image available on Docker Hub.

docker pull intermine/bluegenes:latest

### Dokku

[Dokku](http://dokku.viewdocs.io/dokku/) allows you to push a Git branch and have it automatically build and serve it using the appropriate docker container. (You can also use BlueGenes with [heroku](https://www.heroku.com/).)

Once dokku is configured on your remote host, you'll need to add your public key, create a remote for your host and push to it:

Expand All @@ -139,7 +155,7 @@ To compile and package BlueGenes into an executable jar, run the following comma

lein uberjar

Then, to start the application, execute the jar and pass in a [`config.edn` file](../config/dev/README.md):
Then, to start the application, execute the jar and pass in a [`config.edn` file](/docs/configuring.md):

java -jar -Dconfig="config/prod/config.edn" target/bluegenes.jar

Expand Down
27 changes: 15 additions & 12 deletions docs/configuring.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
# Configuration
# Configuring BlueGenes

This applies primarily to standalone BlueGenes.
## Environment variables

| Envvar | Description | Default |
| ------ | ----------- | ------- |
| SERVER_PORT | Port used by web server | 5000 |
| LOGGING_LEVEL | Minimum level for logging | :info |
| GOOGLE_ANALYTICS | Google Analytics tracking ID | nil |
| JWT_SECRET | Secret for signing JSON Web Tokens | nil |
| BLUEGENES_DEFAULT_SERVICE_ROOT | InterMine service that is default | https://alpha.flymine.org/alpha/ |
| BLUEGENES_DEFAULT_MINE_NAME | Optional default mine name to display until it gets fetched | FlyMine |
| BLUEGENES_TOOL_PATH | Server directory where BlueGenes tools are installed | ./tools |

## Note: Ways to Configure
## How to configure

The preferred way to configure BlueGenes is via `.edn` configuration files, and it is the one being explained here. All keys can be overridden with environment variables. Please refer to [Yogthos's config docs](https://github.com/yogthos/config#yogthosconfig) for more details regarding this method.
BlueGenes supports the many methods of specifying configuration keys provided by [Yogthos' config](https://github.com/yogthos/config#yogthosconfig). The configuration keys listed above can be specified in uppercase or lowercase, and with dashes, underscores or periods as separators.


## Configuration via `.edn` files
### Configuration via `config.edn` files

Copy and paste the code from the `.template` files in `config/dev/` and `config/prod/`, tweak it to match your preferences, and save it as `config.edn` in the same folder.


### Analytics (optional)

For now, the only supported statistics service is [Google analytics](https://analytics.google.com/). If you wish to use this service, configure your domain and then add your Google Analytics ID.

```clojure
{:google-analytics "UA-12345678-9"}
```
For now, the only supported statistics service is [Google analytics](https://analytics.google.com/). If you wish to use this service, configure your domain and then add your Google Analytics ID using the `GOOGLE_ANALYTICS` key listed above.

0 comments on commit ab134b7

Please sign in to comment.