Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
eduadiez committed Jul 14, 2019
1 parent a35542e commit b5fe993
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 111 deletions.
28 changes: 23 additions & 5 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FROM golang:alpine AS cosmos-build
ENV PACKAGES ca-certificates curl make git libc-dev bash gcc linux-headers eudev-dev python

# Set cosmos-sdk version
ENV COSMOS_VERSION v0.34.7
ENV COSMOS_VERSION v0.35.0

# Install minimum necessary dependencies, build Cosmos SDK, remove packages
RUN apk add --no-cache $PACKAGES
Expand All @@ -28,15 +28,30 @@ WORKDIR /usr/src/app/cosmos-sdk
RUN make tools && \
make install

# Generating certificates
FROM alpine:edge as certificates

RUN apk add --no-cache openssl

WORKDIR /opt/ssl

RUN PASSWORD=$(echo $(LC_CTYPE=C tr -dc 'A-HJ-NPR-Za-km-z2-9' < /dev/urandom | head -c 20)) && \
openssl genrsa -des3 -passout pass:${PASSWORD} -out server.pass.key 2048 && \
openssl rsa -passin pass:${PASSWORD} -in server.pass.key -out server.key && \
rm server.pass.key && \
openssl req -new -key server.key -out server.csr -subj "/C=DE/ST=Decentraland/L=Decentraland/O=cosmos.public.dappnode/OU=cosmos.public.dappnode/CN=cosmos.public.dappnode" && \
openssl x509 -req -sha256 -days 300065 -in server.csr -signkey server.key -out server.crt

# Lunie builder image
FROM alpine:edge as lunie-build

# Install deps
RUN apk add --no-cache ca-certificates bash git wget curl nodejs nodejs-npm yarn python make g++ tmux
RUN apk add --no-cache ca-certificates bash git wget curl nodejs nodejs-npm yarn python make g++ tmux openssl
WORKDIR /usr/src/app

ENV LUNIE_VERSION v1.0.0-beta.96
# Clone Lunie repository
RUN git clone --branch master https://github.com/luniehq/lunie.git
RUN git clone --branch ${LUNIE_VERSION} https://github.com/luniehq/lunie.git

# Build the Lunie APP
RUN cd lunie \
Expand Down Expand Up @@ -67,8 +82,11 @@ COPY --from=lunie-build /usr/src/app/lunie/dist /usr/share/nginx/html/lunie
# Copy over binaries from the build
COPY --from=cosmos-build /go/bin/gaiad /go/bin/gaiacli /usr/bin/

COPY --from=certificates /opt/ssl/server.key /opt/ssl/server.crt /etc/nginx/certs/

RUN mkdir -p /root/.gaiad/config
# Copy default config and genesis
COPY config/config.toml config/genesis.json config/key.pem config/cert.pem /usr/src/app/
COPY config/config.toml config/genesis.json /root/.gaiad/config/
COPY config/swagger.json config/index.html /usr/share/nginx/html/
COPY config/nginx.conf /etc/nginx/

Expand All @@ -80,5 +98,5 @@ RUN chmod +x /usr/bin/start_script.sh
# Start
###############################################################################
# Run gaiad by default, omit entrypoint to ease using container with gaiacli
EXPOSE 26656 26657 1317 443
EXPOSE 26656
ENTRYPOINT start_script.sh
29 changes: 0 additions & 29 deletions build/config/cert.pem

This file was deleted.

52 changes: 0 additions & 52 deletions build/config/key.pem

This file was deleted.

8 changes: 4 additions & 4 deletions build/config/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ http {
listen 26657 ssl;
server_name cosmos.public.dappnode;

ssl_certificate /etc/nginx/certs/cert.pem;
ssl_certificate_key /etc/nginx/certs/key.pem;
ssl_certificate /etc/nginx/certs/server.crt;
ssl_certificate_key /etc/nginx/certs/server.key;

location / {
expires 1d;
Expand All @@ -53,8 +53,8 @@ http {
server_name cosmos.public.dappnode;
index index.html index.htm;

ssl_certificate /etc/nginx/certs/cert.pem;
ssl_certificate_key /etc/nginx/certs/key.pem;
ssl_certificate /etc/nginx/certs/server.crt;
ssl_certificate_key /etc/nginx/certs/server.key;

location / {
proxy_pass http://localhost:1317;
Expand Down
11 changes: 0 additions & 11 deletions build/start_script.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
#!/bin/sh
# Start the first process

mkdir -p /root/.gaiad/config

cp /usr/src/app/genesis.json /root/.gaiad/config/genesis.json

cp /usr/src/app/config.toml /root/.gaiad/config/config.toml

cp /usr/src/app/*.pem /etc/nginx/certs
cp /usr/src/app/*.pem /root/.gaiad/config

nginx > /dev/null 2>&1 &

/bin/sh /usr/bin/start_rest.sh > /dev/null 2>&1 &

gaiad start
Binary file removed cosmos-avatar.jpg
Binary file not shown.
Binary file added cosmos-avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 6 additions & 9 deletions dappnode_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@
"name": "cosmos.public.dappnode.eth",
"version": "0.0.3",
"description": "Cosmos Network fullnode and Lunie web Wallet.",
"avatar": "/ipfs/Qmdj6YhkErGKB22hcLTe6WBvs3SunKREVUkkmDip18yLyX",
"avatar": "/ipfs/QmT1BjXYwmLh9FmeT8DUywWhx2aDctMCZLLPcWqXLz5vc5",
"type": "service",
"image": {
"path": "",
"hash": "",
"size": "",
"path": "cosmos.public.dappnode.eth_0.0.3.tar.xz",
"hash": "/ipfs/QmRwy5b4qdsW9N5j4aATr144r3Cp45TZJXWCpeb7mpPDiw",
"size": 42591812,
"restart": "always",
"volumes": [
"cosmos:/root/.gaiad"
],
"ports": [
"26656:26656",
"26657:26657",
"1317:1317",
"443:443"
"26656:26656"
],
"keywords": [
"DAppNode",
Expand Down Expand Up @@ -46,4 +43,4 @@
"url": "https://github.com/Colm3na/DAppNodePackage-cosmos/issues"
},
"license": "GPL-3.0"
}
}
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.4'
services:
cosmos.public.dappnode.eth:
image: 'cosmos.public.dappnode.eth:0.0.2'
image: 'cosmos.public.dappnode.eth:0.0.3'
build: ./build
volumes:
- 'cosmos:/root/.gaiad'
Expand Down

0 comments on commit b5fe993

Please sign in to comment.