From 95aed5060f1630b4cced16725cdfc77fc8714021 Mon Sep 17 00:00:00 2001 From: vladupshot <154623109+vladupshot@users.noreply.github.com> Date: Fri, 29 Dec 2023 11:45:22 +1300 Subject: [PATCH] Add build step to the dockerfiel --- docker/Dockerfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index e906278..a9285d7 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,3 +1,13 @@ +FROM --platform=linux/amd64 golang:1.21-bookworm AS builder + +WORKDIR /src + +ADD . /src + +RUN go mod download && \ + make all + +########################### FROM --platform=linux/amd64 ubuntu:latest ARG ghcr_token @@ -32,8 +42,8 @@ RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2 ## setup RUN mkdir /app/keys -COPY ./dist/upshot-node upshot-node -COPY ./dist/upshot-keys upshot-keys +COPY --from=builder /src/dist/upshot-node upshot-node +COPY --from=builder /src/dist/upshot-keys upshot-keys ## run script COPY ./docker/run.sh ./run.sh