forked from bitshares/bitshares-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker to build the web wallet and serve it. (bitshares#1033)
- Loading branch information
Showing
5 changed files
with
109 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM node:6 | ||
|
||
# Install nginx | ||
RUN apt-get update \ | ||
&& apt-get install -y nginx --no-install-recommends \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
RUN npm install -g cross-env | ||
|
||
# We copy the code from the docker-compose-yml | ||
# RUN git clone https://github.com/bitshares/bitshares-ui.git /bitshares-ui | ||
CMD mkdir /bitshares-ui | ||
WORKDIR /bitshares-ui | ||
|
||
ADD package.json . | ||
RUN cross-env npm install --env.prod | ||
|
||
EXPOSE 80 | ||
|
||
## Copying default configuration | ||
ADD conf/nginx.conf /etc/nginx/nginx.conf | ||
ADD conf/start.sh /start.sh | ||
RUN chmod a+x /start.sh | ||
|
||
## Entry point | ||
ENTRYPOINT ["/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
|
||
worker_processes 4; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
include mime.types; | ||
default_type application/octet-stream; | ||
|
||
sendfile on; | ||
|
||
keepalive_timeout 165; | ||
|
||
gzip on; | ||
gzip_disable "msie6"; | ||
gzip_comp_level 6; | ||
gzip_min_length 1100; | ||
gzip_buffers 16 8k; | ||
gzip_proxied any; | ||
gzip_types | ||
text/plain | ||
text/css | ||
text/js | ||
text/xml | ||
text/javascript | ||
application/javascript | ||
application/x-javascript | ||
application/json | ||
application/xml | ||
application/rss+xml | ||
image/svg+xml; | ||
|
||
server { | ||
listen 80; | ||
server_name _; | ||
root /var/www/; | ||
|
||
ssl off; | ||
# @TODO configure ssl | ||
|
||
location ~ ^/(img|images|photo|photos|page|pages|uploads|countries|make|pic|foto|list|pictures|news|feed|rotated|carimg|category|reviews) { | ||
access_log off; | ||
return 404; | ||
} | ||
|
||
# This makes the faucet work | ||
location ~ ^/[\w\d\.-]+\.(js|css|dat|png|json|ico)$ { | ||
try_files $uri $uri/wallet =404; | ||
} | ||
|
||
location / { | ||
index index.html index.htm; | ||
try_files $uri /index.html; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
# We build the wallet each time we run the docker and it takes a couple of minutes | ||
npm run build | ||
|
||
cp -r /bitshares-ui/build/dist/* /var/www/ | ||
|
||
nginx -g "daemon off;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: "2" | ||
volumes: | ||
wallet_build: {} | ||
|
||
services: | ||
web-wallet: | ||
build: . | ||
ports: | ||
- "8080:80" | ||
volumes: | ||
- wallet_build:/bitshares-ui/build/dist | ||
- .:/bitshares-ui |