alby-hub/Dockerfile
Michael Bumann 2e7af2e38c
Test fmar (#242)
* go 1.21.x

* don't use alpine

* don't copy

* go-version: 1.21.x

* don't run tests

* wget libbreez_sdk_bindings and copy it into final

* wails worflow

* wails worflow

* wails worflow

* wails worflow

* wails worflow

* wails worflow

* prepare:http

* remove alby-deployment stuff

* uncomment tests

* uncomment tests

* remove workflow, multiplatform only amd64 for now

* try building for arm64

* GOARCH=$(echo "$TARGETPLATFORM" | cut -d'/' -f2)

* update to github.com/breez/breez-sdk-go v0.2.14

* update to github.com/breez/breez-sdk-go v0.2.14

* add linux/386

* wails doctor

* wails doctor

---------

Co-authored-by: Fmar <frnandu@gmail.com>
2024-01-30 12:35:06 +02:00

51 lines
1.3 KiB
Docker

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" ]