Evan Feenstra
4 years ago
9 changed files with 181 additions and 85 deletions
@ -0,0 +1 @@ |
|||
node_modules |
@ -0,0 +1,56 @@ |
|||
name: Docker build on push |
|||
env: |
|||
DOCKER_CLI_EXPERIMENTAL: enabled |
|||
|
|||
on: |
|||
push: |
|||
tags: |
|||
- '*' |
|||
|
|||
jobs: |
|||
build: |
|||
runs-on: ubuntu-18.04 |
|||
name: Build and push Relay image |
|||
env: |
|||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true |
|||
steps: |
|||
- name: Check out from Git |
|||
uses: actions/checkout@v2 |
|||
- name: Test env |
|||
run: echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV |
|||
- name: Test print env |
|||
run: | |
|||
echo $RELEASE_TAG |
|||
echo ${{ env.RELEASE_TAG }} |
|||
- name: Login to Docker Hub |
|||
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin |
|||
- name: Checkout project |
|||
uses: actions/checkout@v2 |
|||
- name: Setup Docker buildx action |
|||
uses: crazy-max/ghaction-docker-buildx@v1 |
|||
id: buildx |
|||
with: |
|||
buildx-version: latest |
|||
qemu-version: latest |
|||
- name: Show available buildx platforms |
|||
run: echo ${{ steps.buildx.outputs.platforms }} |
|||
- name: Cache Docker layers |
|||
uses: actions/cache@v2 |
|||
id: cache |
|||
with: |
|||
path: /tmp/.buildx-cache |
|||
key: ${{ runner.os }}-buildx-${{ github.sha }} |
|||
restore-keys: | |
|||
${{ runner.os }}-buildx- |
|||
- name: Test print env |
|||
run: | |
|||
echo $RELEASE_TAG |
|||
echo ${{ env.RELEASE_TAG }} |
|||
- name: Run Docker buildx |
|||
run: | |
|||
docker buildx build \ |
|||
--cache-from "type=local,src=/tmp/.buildx-cache" \ |
|||
--cache-to "type=local,dest=/tmp/.buildx-cache" \ |
|||
--platform linux/amd64,linux/arm64,linux/arm/v7 \ |
|||
--tag "${{ secrets.DOCKER_HUB_USER }}/sphinx-relay:${{ env.RELEASE_TAG }}" \ |
|||
--output "type=registry" ./ |
@ -1,92 +1,33 @@ |
|||
FROM golang:1.13-alpine as builder |
|||
LABEL maintainer="gonzaloaune@stakwork.com" |
|||
FROM node:12-buster-slim AS builder |
|||
|
|||
# Force Go to use the cgo based DNS resolver. This is required to ensure DNS |
|||
# queries required to connect to linked containers succeed. |
|||
ENV GODEBUG netdns=cgo |
|||
WORKDIR /relay |
|||
RUN mkdir /relay/.lnd |
|||
RUN touch /relay/connection_string.txt |
|||
RUN chmod 777 /relay/connection_string.txt |
|||
RUN cp /relay/config/app.json /relay/dist/config/app.json |
|||
RUN cp /relay/config/config.json /relay/dist/config/config.json |
|||
COPY . . |
|||
|
|||
# Pass a tag, branch or a commit using build-arg. This allows a docker |
|||
# image to be built from a specified Git state. The default image |
|||
# will use the Git tip of master by default. |
|||
ARG checkout="v0.11.1-beta" |
|||
# ARG checkout="master" |
|||
RUN apt-get update |
|||
|
|||
# Install dependencies and build the binaries. |
|||
RUN apk add --no-cache --update alpine-sdk git make gcc openssh-client |
|||
RUN apt install -y make python-minimal |
|||
RUN apt install -y g++ gcc libmcrypt-dev |
|||
|
|||
RUN git clone https://github.com/lightningnetwork/lnd /go/src/github.com/lightningnetwork/lnd |
|||
RUN cd /go/src/github.com/lightningnetwork/lnd \ |
|||
&& git checkout $checkout \ |
|||
&& make \ |
|||
&& make install tags="signrpc walletrpc chainrpc invoicesrpc experimental" |
|||
|
|||
# Start a new, final image. |
|||
FROM alpine:3.11 as final |
|||
|
|||
EXPOSE 80 |
|||
EXPOSE 9735 |
|||
|
|||
ENV NODE_ENV production |
|||
ENV NODE_SCHEME http |
|||
|
|||
# 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/ |
|||
|
|||
RUN apk add --no-cache --update nodejs=12.15.0-r1 nodejs-npm=12.15.0-r1 sqlite=3.30.1-r2 git supervisor |
|||
|
|||
RUN git clone https://github.com/stakwork/sphinx-relay /relay/ |
|||
|
|||
WORKDIR /relay/ |
|||
|
|||
ARG sphinx_checkout="master" |
|||
|
|||
RUN git checkout $sphinx_checkout |
|||
|
|||
RUN apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python jq git curl libmcrypt-dev |
|||
|
|||
USER root |
|||
|
|||
RUN rm -rf node_modules/ |
|||
RUN npm install bcrypt |
|||
RUN npm install |
|||
RUN npm install --quiet node-gyp@3.8.0 -g |
|||
RUN npm -g config set user root |
|||
RUN npm install nw-gyp -g |
|||
RUN npm uninstall sqlite3 |
|||
RUN npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=x64 --target=0.42.0 |
|||
RUN npm uninstall sqlite3 |
|||
RUN npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=x64 --target=0.42.0 |
|||
RUN npm rebuild |
|||
RUN npm run tsc |
|||
|
|||
VOLUME /relay/.lnd |
|||
|
|||
COPY ./docker/lnd.conf.sample /relay/.lnd/lnd.conf |
|||
FROM node:12-buster-slim |
|||
|
|||
#Uncomment if you have a copy of the channel.db you want to use. |
|||
#COPY ./channel.db /relay/.lnd/data/graph/mainnet/ |
|||
USER 1000 |
|||
|
|||
RUN git clone https://github.com/stakwork/sphinx-keysend-test/ /sphinx-keysend/ |
|||
WORKDIR /sphinx-keysend/ |
|||
WORKDIR /relay |
|||
|
|||
ARG sphinx_keysend_checkout="binary" |
|||
COPY --from=builder /relay . |
|||
|
|||
RUN git checkout $sphinx_keysend_checkout |
|||
RUN npm install |
|||
EXPOSE 3300 |
|||
|
|||
WORKDIR /relay/ |
|||
|
|||
RUN apk --no-cache add expect bash |
|||
|
|||
RUN mkdir -p /var/log/supervisor |
|||
COPY ./docker/supervisord.conf /etc/supervisord.conf |
|||
COPY ./docker/lnd_supervisor.conf /etc/supervisor.d/lnd_supervisor.ini |
|||
COPY ./docker/relay_supervisor.conf /etc/supervisor.d/relay_supervisor.ini |
|||
COPY ./docker/aliases.sh /etc/profile.d/aliases.sh |
|||
|
|||
ENV ENV="/etc/profile" |
|||
ENV NODE_ENV production |
|||
ENV NODE_SCHEME http |
|||
ENV PORT 3300 |
|||
|
|||
ENTRYPOINT [ "bash", "/relay/docker/entrypoint.sh" ] |
|||
CMD [ "node", "/relay/dist/app.js" ] |
|||
|
@ -0,0 +1,92 @@ |
|||
FROM golang:1.13-alpine as builder |
|||
LABEL maintainer="gonzaloaune@stakwork.com" |
|||
|
|||
# Force Go to use the cgo based DNS resolver. This is required to ensure DNS |
|||
# queries required to connect to linked containers succeed. |
|||
ENV GODEBUG netdns=cgo |
|||
|
|||
# Pass a tag, branch or a commit using build-arg. This allows a docker |
|||
# image to be built from a specified Git state. The default image |
|||
# will use the Git tip of master by default. |
|||
ARG checkout="v0.11.1-beta" |
|||
# ARG checkout="master" |
|||
|
|||
# Install dependencies and build the binaries. |
|||
RUN apk add --no-cache --update alpine-sdk git make gcc openssh-client |
|||
|
|||
RUN git clone https://github.com/lightningnetwork/lnd /go/src/github.com/lightningnetwork/lnd |
|||
RUN cd /go/src/github.com/lightningnetwork/lnd \ |
|||
&& git checkout $checkout \ |
|||
&& make \ |
|||
&& make install tags="signrpc walletrpc chainrpc invoicesrpc experimental" |
|||
|
|||
# Start a new, final image. |
|||
FROM alpine:3.11 as final |
|||
|
|||
EXPOSE 80 |
|||
EXPOSE 9735 |
|||
|
|||
ENV NODE_ENV production |
|||
ENV NODE_SCHEME http |
|||
|
|||
# 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/ |
|||
|
|||
RUN apk add --no-cache --update nodejs=12.15.0-r1 nodejs-npm=12.15.0-r1 sqlite=3.30.1-r2 git supervisor |
|||
|
|||
RUN git clone https://github.com/stakwork/sphinx-relay /relay/ |
|||
|
|||
WORKDIR /relay/ |
|||
|
|||
ARG sphinx_checkout="master" |
|||
|
|||
RUN git checkout $sphinx_checkout |
|||
|
|||
RUN apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python jq git curl libmcrypt-dev |
|||
|
|||
USER root |
|||
|
|||
RUN rm -rf node_modules/ |
|||
RUN npm install |
|||
RUN npm install --quiet node-gyp@3.8.0 -g |
|||
RUN npm -g config set user root |
|||
RUN npm install nw-gyp -g |
|||
RUN npm uninstall sqlite3 |
|||
RUN npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=x64 --target=0.42.0 |
|||
RUN npm uninstall sqlite3 |
|||
RUN npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=x64 --target=0.42.0 |
|||
RUN npm rebuild |
|||
RUN npm run tsc |
|||
|
|||
VOLUME /relay/.lnd |
|||
|
|||
COPY ./docker/lnd.conf.sample /relay/.lnd/lnd.conf |
|||
|
|||
#Uncomment if you have a copy of the channel.db you want to use. |
|||
#COPY ./channel.db /relay/.lnd/data/graph/mainnet/ |
|||
|
|||
RUN git clone https://github.com/stakwork/sphinx-keysend-test/ /sphinx-keysend/ |
|||
WORKDIR /sphinx-keysend/ |
|||
|
|||
ARG sphinx_keysend_checkout="binary" |
|||
|
|||
RUN git checkout $sphinx_keysend_checkout |
|||
RUN npm install |
|||
|
|||
WORKDIR /relay/ |
|||
|
|||
RUN apk --no-cache add expect bash |
|||
|
|||
RUN mkdir -p /var/log/supervisor |
|||
COPY ./docker/supervisord.conf /etc/supervisord.conf |
|||
COPY ./docker/lnd_supervisor.conf /etc/supervisor.d/lnd_supervisor.ini |
|||
COPY ./docker/relay_supervisor.conf /etc/supervisor.d/relay_supervisor.ini |
|||
COPY ./docker/aliases.sh /etc/profile.d/aliases.sh |
|||
|
|||
ENV ENV="/etc/profile" |
|||
|
|||
ENTRYPOINT [ "bash", "/relay/docker/entrypoint.sh" ] |
@ -1 +1 @@ |
|||
{"version":3,"file":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