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

Reformat readme #4

Open
wants to merge 5 commits into
base: master
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
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Stellar Bifrost
# Stellar Bifrost

### The simplest and cleanest Docker image for running bifrost
## The simplest and cleanest Docker image for running bifrost

Build and run:
```
Expand All @@ -12,14 +12,20 @@ Defaults to testnet.

Creates a folder 'stellar' in your home folder. Everything is stored there, delete it to reset.

You'll need to edit the docker-compose.yml files to change environment vars to match your setup:
MASTER_PUBLIC_KEY, BIFROST_STELLAR_ISSUER_PUBLIC_KEY, BIFROST_STELLAR_SIGNER_SECRET_KEY, TOKEN_ASSET_CODE

Edit docker-compose.yml for mainnet

Pull requests welcome!

### Donations
## Setup

Look at `docker-compose.yml` as a guide.

### Config

- *From environment variables*. You can specify the environment variables (see `docker-compose.yml`) and allow `entry.sh` to generate the config file for you.
- *Supply your own `bifrost.cfg`*. If `entry.sh` sees a file in `/opt/bifrist/bifrost.cfg`, it will use that and ignore any environment variables. This is useful when you need a more customized cfg, and attaching a volume (like a configmap or secret in Kubernetes) is easier.

## Donations
If you like this code, a [`donation`](https://stellarkit.io/#/donate) would be appreciated.

```
Expand Down
23 changes: 12 additions & 11 deletions bifrost-docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
FROM golang:alpine as builder
FROM golang:1.9.3-alpine3.7 as builder

ADD apk-build /apk-build
RUN chmod +x /apk-build
RUN /apk-build

# deploy bifrost binary
RUN mkdir -p /go/src/github.com/stellar/ \
&& git clone --depth 1 --branch master https://github.com/stellar/go.git /go/src/github.com/stellar/go \
&& cd /go/src/github.com/stellar/go \
&& curl https://glide.sh/get | sh \
&& glide install \
&& go install github.com/stellar/go/services/bifrost

# deploy db init script
ADD initbifrost /go/src/github.com/stellar/initbifrost
RUN go get github.com/lib/pq \
&& go install github.com/stellar/initbifrost
&& git clone --depth 1 --branch master https://github.com/stellar/go.git /go/src/github.com/stellar/go

ENV BIFROST_VERSION=v0.0.1
ENV BIFROST_URL=https://github.com/stellar/go/releases/download/bifrost-$BIFROST_VERSION/bifrost-linux-amd64
RUN wget $BIFROST_URL
RUN chmod +x bifrost-linux-amd64 && mv bifrost-linux-amd64 /go/bin/bifrost

# deploy db init script
ADD initbifrost /go/src/github.com/stellar/initbifrost
RUN go get github.com/lib/pq \
&& go install github.com/stellar/initbifrost


# -----------------------
Expand Down
8 changes: 7 additions & 1 deletion bifrost-docker/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
set -e

function main() {
build-config /configs/config.toml > /opt/bifrost/bifrost.cfg
BIFROST_CFG=/opt/bifrost/bifrost.cfg
if [ -f $BIFROST_CFG ]; then
echo "$BIFROST_CFG exists; skipping generation"
else
echo "$BIFROST_CFG does not exist; generating from environment variables"
build-config /configs/config.toml > /opt/bifrost/bifrost.cfg
fi

build-config /configs/pgpass-config > /root/.pgpass
chmod 600 /root/.pgpass
Expand Down