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

Docker: fix builds #157

Merged
merged 10 commits into from
Jan 2, 2019
Merged
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
13 changes: 11 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,31 @@ RUN apk upgrade --no-cache && \
apk add --no-cache git python make g++ bash && \
npm install -g npm@$NPM_VERSION

# install dependencies for node-hid
RUN apk add --no-cache linux-headers eudev-dev libusb-dev
# install handshake deps
RUN apk add --no-cache unbound-dev

COPY package.json \
package-lock.json \
/usr/src/app/

# Install dependencies
FROM base AS build
# install dependencies for node-hid
RUN apk add --no-cache linux-headers eudev-dev libusb-dev

# dont run preinstall scripts here
# by omitting --unsafe-perm
RUN npm install

# this is a grandchild dependency of hsd that gets skipped for some reason
# and needs to be installed manually
RUN npm install budp

# Bundle app
FROM base
COPY --from=build /usr/src/app/node_modules /usr/src/app/node_modules
COPY pkg.js /usr/src/app/pkg.js
COPY vendor /usr/src/app/vendor
COPY scripts /usr/src/app/scripts
COPY configs /usr/src/app/configs
COPY server /usr/src/app/server
Expand Down
1 change: 0 additions & 1 deletion Dockerfile-bcoin
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ RUN npm init -y &>/dev/null \
bcoin-org/blgr \
bcoin-org/bclient


# TODO: Inherit from official image
FROM base

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ progress in your container.
Read more about how to connect a local instance of bPanel to a bcoin node running in docker
[here](#local-bpanel-dev-using-bcoin-docker-container).

#### Plugins with Docker Compose
It's possible to set which plugins you want loaded via an environment variable `BPANEL_PLUGINS`.
The docker compose has this set for you and can be customized according to your needs.
Note however that once set, they cannot be edited using the methods listed
[below](#managing-plugins). To make changes, you will need to edit `docker-compose.yml` and
restart the container. Comment out this environment variable to use the config.js instead.

## Managing Plugins

Plugin management is handled in a `config.js` file located by default in the `.bpanel` directory in your
Expand Down
16 changes: 10 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ services:
## Build to use local Dockerfile
# build: .
## Build from image from docker hub
image: bpanel/bpanel
image: bpanel/bpanel:dev
restart: unless-stopped
environment:
# Need this to tell the bpanel client
# how to communicate with the bcoin node
# in docker
_DOCKER_NODE_HOST: bcoin
# Edit this to add/remove plugins! This cannot be edited after startup
# even with bpanel's config.js. Must edit below, and rebuild container.
BPANEL_PLUGINS: '@bpanel/genesis-theme,@bpanel/bui,@bpanel/connection-manager'
ports:
- "5000:5000"
- "5001:5001"
- "8000:8000"
volumes:
## Mapping to local files- Handy for dev
Expand Down Expand Up @@ -44,15 +48,15 @@ services:

bcoin:
## Use image to to pull from docker hub
image: bpanel/bcoin
image: bpanel/bcoin:dev
## Build to use local Dockerfile-bcoin
# build:
# context: .
# dockerfile: Dockerfile-bcoin
# args:
# repo: https://github.com/bcoin-org/bcoin.git
# branch: master
# rebuild: 0
# args:
# repo: https://github.com/bcoin-org/bcoin.git
# branch: master
# rebuild: 0
restart: unless-stopped
env_file:
# Set arguments to use in bcoin-init.js
Expand Down
2 changes: 1 addition & 1 deletion securityc.env
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ KEY_OUT=/etc/ssl/nginx/tls.key
USE_NGINX=true
NGINX_SSL_CERTIFICATE=/etc/ssl/nginx/tls.crt
NGINX_SSL_CERTIFICATE_KEY=/etc/ssl/nginx/tls.key
NGINX_UPSTREAM_URI=app:5000
NGINX_UPSTREAM_URI=bpanel:5000
1 change: 0 additions & 1 deletion webapp/plugins/local
Submodule local deleted from 754b13
3 changes: 3 additions & 0 deletions webapp/plugins/local/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# commit empty directory
# build-plugins script will generate an index.js file
# in this directory automatically