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

With or without docker #947

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
add docker-compose and environment files
Darren Nelsen committed May 9, 2018
commit 583b25aa1592c9b1dac84cc1ab486311c2f7e714
10 changes: 10 additions & 0 deletions app/.docker/docker-insight.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:8.11.1
MAINTAINER SonicWizard
COPY . /var/www
#WORKDIR /var/www

COPY ./.docker/scripts /scripts
RUN chmod +rx /scripts/replace.sh

EXPOSE 8100
ENTRYPOINT ["/scripts/replace.sh"]
4 changes: 4 additions & 0 deletions app/.docker/env/bch.development.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DEFAULT_CURRENCY=BCH
API_PREFIX=/api
IONIC_PATH=/api
IONIC_PROXY_URL=https://bch-insight.bitpay.com/api
4 changes: 4 additions & 0 deletions app/.docker/env/bch.production.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DEFAULT_CURRENCY=BCH
API_PREFIX=/api
IONIC_PATH=/api
IONIC_PROXY_URL=https://bch-insight.bitpay.com/api
4 changes: 4 additions & 0 deletions app/.docker/env/btc.development.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DEFAULT_CURRENCY=BTC
API_PREFIX=/api
IONIC_PATH=/api
IONIC_PROXY_URL=https://insight.bitpay.com/api
4 changes: 4 additions & 0 deletions app/.docker/env/btc.production.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DEFAULT_CURRENCY=BTC
API_PREFIX=/api
IONIC_PATH=/api
IONIC_PROXY_URL=https://insight.bitpay.com/api
11 changes: 11 additions & 0 deletions app/.docker/scripts/replace.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

cd /var/www
npm install
npm rebuild node-sass
npm install -g replace
replace '%DEFAULT_CURRENCY%' ${DEFAULT_CURRENCY} src/providers/currency/currency.ts
replace '%API_PREFIX%' ${API_PREFIX} src/providers/api/api.ts
replace '%IONIC_PATH%' ${IONIC_PATH} ionic.config.json
replace '%IONIC_PROXY_URL%' ${IONIC_PROXY_URL} ionic.config.json
npm start
21 changes: 0 additions & 21 deletions app/docker-bch.dockerfile

This file was deleted.

21 changes: 0 additions & 21 deletions app/docker-btc.dockerfile

This file was deleted.

30 changes: 30 additions & 0 deletions app/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: '2'

services:
insight-ui-btc:
container_name: insight-ui-btc-${ENV}
build:
context: .
dockerfile: .docker/docker-insight.dockerfile
ports:
- "4447:8100"
env_file:
- ./.docker/env/btc.${ENV}.env
networks:
- insight-network

insight-ui-bch:
container_name: insight-ui-bch-${ENV}
build:
context: .
dockerfile: .docker/docker-insight.dockerfile
ports:
- "4448:8100"
env_file:
- ./.docker/env/bch.${ENV}.env
networks:
- insight-network

networks:
insight-network:
driver: bridge
1 change: 0 additions & 1 deletion app/src/providers/api/api.ts
Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@ export class ApiProvider {
public apiPrefix: string;

constructor(public http: Http) {
// TODO Make this an API call
this.apiPrefix = '%API_PREFIX%/';
}

1 change: 0 additions & 1 deletion app/src/providers/currency/currency.ts
Original file line number Diff line number Diff line change
@@ -21,7 +21,6 @@ export class CurrencyProvider {
public explorers: any = [];

constructor(public http: Http, private api: ApiProvider) {
// TODO Make this an API call
this.defaultCurrency = '%DEFAULT_CURRENCY%';
this.currencySymbol = this.defaultCurrency;