deploy templates (#276)

This commit is contained in:
Michael Bumann 2024-05-24 10:33:16 +03:00 committed by GitHub
parent 1729514909
commit cfc56e3383
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 33 additions and 64 deletions

View file

@ -1,51 +0,0 @@
FROM node:19-alpine as frontend
WORKDIR /build
COPY frontend ./frontend
RUN cd frontend && yarn install && yarn build:http
FROM golang:1.21 as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"
RUN apt-get update && \
apt-get install -y gcc
ENV CGO_ENABLED=1
ENV GOOS=linux
#ENV GOARCH=$GOARCH
#RUN echo "AAA $GOARCH"
# Move to working directory /build
WORKDIR /build
# Copy and download dependency using go mod
COPY go.mod .
COPY go.sum .
RUN GOARCH=$(echo "$TARGETPLATFORM" | cut -d'/' -f2) go mod download
# Copy the code into the container
COPY . .
# Copy frontend dist files into the container
COPY --from=frontend /build/frontend/dist ./frontend/dist
RUN GOARCH=$(echo "$TARGETPLATFORM" | cut -d'/' -f2) go build -o main .
RUN wget https://github.com/breez/breez-sdk-go/raw/main/breez_sdk/lib/linux-amd64/libbreez_sdk_bindings.so
# Start a new, final image to reduce size.
FROM debian as final
ENV LD_LIBRARY_PATH=/usr/lib/libbreez
#
# # Copy the binaries and entrypoint from the builder image.
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /build/libbreez_sdk_bindings.so /usr/lib/libbreez/
COPY --from=builder /build/main /bin/
ENTRYPOINT [ "/bin/main" ]

View file

@ -1,7 +0,0 @@
name: nwc
services:
- name: web
github:
repo: getAlby/nostr-wallet-connect
branch: feat/onboarding-flow
dockerfile_path: .do/Dockerfile

View file

@ -1,8 +1,14 @@
spec:
name: nwc
name: albyhub
services:
- name: web
github:
branch: feat/onboarding-flow
repo: getAlby/nostr-wallet-connect
deploy_on_push: true
image:
registry_type: GHCR
registry: getalby
repository: nostr-wallet-connect-next
instance_size_slug: basic-xxs
envs:
- key: LDK_ESPLORA_SERVER
value: "https://electrs.albylabs.com"
- key: LOG_EVENTS
value: "true"

View file

@ -20,7 +20,7 @@ type AppConfig struct {
CookieSecret string `envconfig:"COOKIE_SECRET"`
LogLevel string `envconfig:"LOG_LEVEL"`
LDKNetwork string `envconfig:"LDK_NETWORK" default:"bitcoin"`
LDKEsploraServer string `envconfig:"LDK_ESPLORA_SERVER" default:"https://blockstream.info/api"`
LDKEsploraServer string `envconfig:"LDK_ESPLORA_SERVER" default:"https://electrs.albylabs.com"`
LDKGossipSource string `envconfig:"LDK_GOSSIP_SOURCE" default:"https://rapidsync.lightningdevkit.org/snapshot"`
LDKLogLevel string `envconfig:"LDK_LOG_LEVEL"`
MempoolApi string `envconfig:"MEMPOOL_API" default:"https://mempool.space/api"`

21
render.yaml Normal file
View file

@ -0,0 +1,21 @@
services:
- type: web
runtime: image
name: albyhub
image:
url: ghcr.io/getalby/nostr-wallet-connect-next:latest
numInstances: 1
region: frankfurt # Default: oregon
plan: starter
disk:
name: data
mountPath: /data
sizeGB: 1
autoDeploy: false
envVars:
- key: WORK_DIR
value: /data/albyhub
- key: LOG_EVENTS
value: true
- key: LDK_ESPLORA_SERVER
value: "https://electrs.albylabs.com"