Skip to content

Commit

Permalink
Add docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksym Zavershynskyi committed Jun 13, 2019
1 parent 523601c commit 90da464
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/.git
**/node_modules
dist
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# syntax=docker/dockerfile-upstream:experimental

FROM phusion/baseimage:0.11

ENTRYPOINT ["/sbin/my_init", "--"]

RUN curl -o /tmp/node_setup.sh "https://deb.nodesource.com/setup_11.x"
RUN bash /tmp/node_setup.sh
RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo 'deb https://dl.yarnpkg.com/debian/ stable main' | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update -qq && apt-get install -y \
jq \
nodejs \
nginx \
# wallet
ruby-full \
build-essential \
zlib1g-dev \
git \
rsync

# near-wallet
RUN mkdir /near-wallet
COPY . /near-wallet/
WORKDIR /near-wallet
RUN npm install
RUN npm run build
RUN mkdir -p /var/www/html/wallet
RUN rsync -ar /near-wallet/build /var/www/html/wallet

# nginx
RUN rm /etc/nginx/sites-enabled/default
COPY /scripts/wallet.nginx /etc/nginx/sites-enabled/wallet
COPY /scripts/init_nginx.sh /etc/my_init.d/
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ This is in-browser web-based wallet for working with NEAR DevNet accounts. This

DISCLAIMER: This is a developers' preview Wallet. It should be used for NEAR Protocol DevNet only. Learn more at https://wallet.nearprotocol.com


Dockerized Wallet
===

Dockerized wallet operates as a micro-service. It uses nginx to serve the local static content. As the result, Wallet is
not parametrizable with environment variables.
4 changes: 4 additions & 0 deletions scripts/init_nginx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e

/etc/init.d/nginx start
3 changes: 3 additions & 0 deletions scripts/wallet.nginx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
server {
root /var/www/html/wallet;
}

0 comments on commit 90da464

Please sign in to comment.