Gonzalo Javier Aune
5 years ago
5 changed files with 108 additions and 28 deletions
@ -1,16 +1,36 @@ |
|||||
FROM node:8 |
FROM golang:1.13-alpine as builder |
||||
RUN apt-get update |
|
||||
RUN apt-get install -f sqlite3 |
# Force Go to use the cgo based DNS resolver. This is required to ensure DNS |
||||
USER node |
# queries required to connect to linked containers succeed. |
||||
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global |
ENV GODEBUG netdns=cgo |
||||
ENV PATH=$PATH:/home/node/.npm-global/bin |
|
||||
WORKDIR /home/node |
# Pass a tag, branch or a commit using build-arg. This allows a docker |
||||
COPY package.json . |
# image to be built from a specified Git state. The default image |
||||
RUN npm install |
# will use the Git tip of master by default. |
||||
RUN npm install -g nodemon --save-dev |
ARG checkout="master" |
||||
RUN npm install -g express --save-dev |
|
||||
RUN npm install -g webpack webpack-cli --save-dev |
# Install dependencies and build the binaries. |
||||
RUN npm install -g sqlite3 --build-from-source --save-dev |
RUN apk add --no-cache --update alpine-sdk \ |
||||
RUN npm install -g --save-dev sequelize |
git \ |
||||
RUN npm rebuild |
make \ |
||||
COPY . . |
gcc \ |
||||
|
&& git clone https://github.com/lightningnetwork/lnd /go/src/github.com/lightningnetwork/lnd \ |
||||
|
&& cd /go/src/github.com/lightningnetwork/lnd \ |
||||
|
&& git checkout $checkout \ |
||||
|
&& make \ |
||||
|
&& make install tags="signrpc walletrpc chainrpc invoicesrpc" |
||||
|
|
||||
|
# Start a new, final image. |
||||
|
FROM alpine as final |
||||
|
|
||||
|
# Define a root volume for data persistence. |
||||
|
VOLUME /root/.lnd |
||||
|
|
||||
|
# Add bash and ca-certs, for quality of life and SSL-related reasons. |
||||
|
RUN apk --no-cache add \ |
||||
|
bash \ |
||||
|
ca-certificates |
||||
|
|
||||
|
# Copy the binaries from the builder image. |
||||
|
COPY --from=builder /go/bin/lncli /bin/ |
||||
|
COPY --from=builder /go/bin/lnd /bin/ |
||||
|
@ -0,0 +1,26 @@ |
|||||
|
FROM node:8 |
||||
|
RUN apt-get update |
||||
|
RUN apt-get install -f sqlite3 |
||||
|
RUN mkdir /relay/ |
||||
|
RUN chown -R node:node /relay |
||||
|
RUN chmod -R 777 /relay |
||||
|
USER node |
||||
|
# ENV NPM_CONFIG_PREFIX=/relay/.npm-global |
||||
|
# ENV PATH=$PATH:/relay/.npm-global/bin |
||||
|
WORKDIR /relay/ |
||||
|
COPY package.json . |
||||
|
RUN npm install |
||||
|
RUN npm install nodemon --save-dev |
||||
|
RUN npm install express --save-dev |
||||
|
RUN npm install webpack webpack-cli --save-dev |
||||
|
RUN npm install sqlite3 --build-from-source --save-dev |
||||
|
RUN npm install --save-dev sequelize |
||||
|
RUN npm rebuild |
||||
|
COPY . . |
||||
|
USER root |
||||
|
RUN apt-get install telnet |
||||
|
RUN chmod 777 /usr/bin/telnet |
||||
|
RUN chmod -R 777 /relay |
||||
|
RUN chown -R node:node /relay |
||||
|
USER node |
||||
|
RUN npm run tsc |
@ -0,0 +1,35 @@ |
|||||
|
version: '2' |
||||
|
volumes: |
||||
|
node_modules: |
||||
|
|
||||
|
services: |
||||
|
lnd: |
||||
|
build: |
||||
|
context: . |
||||
|
dockerfile: Dockerfile |
||||
|
volumes: |
||||
|
- .lnd/:/root/.lnd |
||||
|
ports: |
||||
|
- "9735:9735" |
||||
|
- "10009:10009" |
||||
|
- "8080:8080" |
||||
|
command: 'lnd --alias=gonza-ireland --restlisten=0.0.0.0:8080 --listen=0.0.0.0:9735 --rpclisten=0.0.0.0:10009 --bitcoin.mainnet --bitcoin.active --bitcoin.node=neutrino' |
||||
|
node_server: |
||||
|
build: |
||||
|
context: . |
||||
|
dockerfile: Dockerfile-node |
||||
|
depends_on: |
||||
|
- lnd |
||||
|
volumes: |
||||
|
- .:/relay:cached |
||||
|
- .lnd/:/relay/.lnd |
||||
|
- node_modules:/relay/node_modules |
||||
|
ports: |
||||
|
- "3000:3000" |
||||
|
tty: true |
||||
|
# command: "npm start" |
||||
|
environment: |
||||
|
- PORT=3000 |
||||
|
- NODE_IP=51.37.119.104 |
||||
|
- NODE_ALIAS=gonza-ireland |
||||
|
- NODE_ENV=production |
Loading…
Reference in new issue