Skip to content

Commit

Permalink
chore: add docker changes and compose (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
kleyow authored Oct 6, 2021
1 parent 444b8fe commit 77c3288
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# First part, build the app
FROM node:16-alpine as reporting-hub-bop-shell-builder
FROM node:lts-alpine as reporting-hub-bop-shell-builder
LABEL stage=reporting-hub-bop-shell-builder

COPY package.json .
Expand All @@ -20,6 +20,15 @@ ENV REACT_APP_COMMIT=$REACT_APP_COMMIT
ARG PUBLIC_PATH
ENV PUBLIC_PATH=$PUBLIC_PATH

# TODO: hard coding these for now since there is no api that
# handles the microfrontend remote locations
ARG REMOTE_1_URL
ENV REMOTE_1_URL=$REMOTE_1_URL

ARG REMOTE_2_URL
ENV REMOTE_2_URL=$REMOTE_2_URL


RUN yarn build

# Second part, create a config at boostrap via entrypoint and and serve it
Expand Down
33 changes: 33 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: "3.7"

networks:
mojaloop-net:
name: mojaloop-net

services:
reporting-hub-bop-shell:
container_name: reporting-hub-bop-shell
image: mojaloop/reporting-hub-bop-shell
build:
context: .
cache_from:
- mojaloop/reporting-hub-bop-shell
args:
- PUBLIC_PATH=https://localhost:8080/
- REMOTE_1_URL=https://localhost:8081
- REMOTE_2_URL=https://localhost:8082
environment:
- API_BASE_URL=/api
- LOGIN_URL=https://your-login-url
- LOGOUT_URL=https://your-logout-url
- AUTH_ENABLED=true
- MOCK_API=true
ports:
- "8080:8080"
networks:
- mojaloop-net
healthcheck:
test: wget -q http://172.17.0.1:8080 -O /dev/null || exit 1
timeout: 20s
retries: 30
interval: 15s
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"docker:build": "docker-compose build --build-arg REACT_APP_VERSION=`npm run version --silent` --build-arg REACT_APP_COMMIT=`git rev-parse HEAD`",
"start": "webpack-dev-server",
"build": "webpack --mode production",
"serve": "serve dist -s -p 3001",
Expand Down

0 comments on commit 77c3288

Please sign in to comment.