This repository has been archived by the owner on Sep 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f5d85d
commit 1dfeb37
Showing
5 changed files
with
77 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# syntax = devthefuture/dockerfile-x | ||
FROM ./docker/Dockerfile | ||
FROM ./docker/Dockerfile_worker | ||
COPY ./docker/requirements.txt /tmp/ | ||
RUN pip install --requirement /tmp/requirements.txt | ||
COPY . /tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
FROM --platform=linux/amd64 golang:1.21-bookworm AS builder | ||
|
||
ADD . /src | ||
WORKDIR /src | ||
ARG GH_TOKEN | ||
RUN git config --global url."https://${GH_TOKEN}@github.com".insteadOf "https://github.com" | ||
ENV GOPRIVATE="github.com/upshot-tech/" | ||
|
||
RUN go mod download && \ | ||
go mod tidy && \ | ||
make all | ||
|
||
########################### | ||
FROM --platform=linux/amd64 python:3.12-slim-bookworm | ||
ENV DEBIAN_FRONTEND=noninteractive \ | ||
USERNAME=appuser \ | ||
APP_PATH=/data | ||
|
||
## curl, unzip other utilities | ||
#! libssl-dev - BLS_RUNTIME dependency # - temporary use libssl 1.1 TODO: Should use fresher libssl | ||
#! gh - to downaload release from priv repo | ||
RUN apt update && \ | ||
apt -y dist-upgrade && \ | ||
apt install -y --no-install-recommends \ | ||
tzdata \ | ||
curl \ | ||
unzip \ | ||
ca-certificates \ | ||
libssl-dev \ | ||
gh && \ | ||
rm -rf /var/cache/apt/* && \ | ||
python3 -m pip install --upgrade pip | ||
|
||
RUN BLS_RUNTIME="v0.3.1" && \ | ||
curl -o ./runtime.tar.gz -sSL https://github.com/blocklessnetwork/runtime/releases/download/${BLS_RUNTIME}/blockless-runtime.linux-latest.x86_64.tar.gz && \ | ||
mkdir -p /app/runtime && tar -xvkf ./runtime.tar.gz -C /app/runtime | ||
ENV RUNETIME_PATH=/app/runtime | ||
|
||
ARG GH_TOKEN | ||
ARG BLS_EXTENSION_VER | ||
# If BLS_EXTENSION_VER install the version else install latest | ||
RUN if [ -n $BLS_EXTENSION_VER]; then \ | ||
gh release download $BLS_EXTENSION_VER \ | ||
--repo "upshot-tech/upshot-blockless-extension" \ | ||
--pattern '*linux-amd64.tar.gz' \ | ||
--output upshot-extension.tar.gz; \ | ||
else \ | ||
gh release download $(gh release list --repo "upshot-tech/upshot-blockless-extension" | grep Latest | awk '{print($1)}') \ | ||
--repo "upshot-tech/upshot-blockless-extension" \ | ||
--pattern '*linux-amd64.tar.gz' \ | ||
--output upshot-extension.tar.gz; \ | ||
fi && \ | ||
mkdir -p /app/runtime/extensions && \ | ||
tar -xvkf ./upshot-extension.tar.gz -C /app/runtime/extensions && \ | ||
rm ./upshot-extension.tar.gz | ||
|
||
COPY --from=builder /src/dist/upshot-node /usr/local/bin/upshot-node | ||
COPY --from=builder /src/dist/upshot-keys /usr/local/bin/upshot-keys | ||
|
||
# Smoke test | ||
RUN /app/runtime/bls-runtime --help && \ | ||
/app/runtime/extensions/upshot-blockless-extension --help | ||
|
||
RUN groupadd -g 1001 ${USERNAME} \ | ||
&& useradd -m -d ${APP_PATH} -u 1001 -g 1001 ${USERNAME} | ||
|
||
USER ${USERNAME} | ||
|
||
VOLUME ${APP_PATH} | ||
EXPOSE 8080 9527 | ||
|
||
ENTRYPOINT ["upshot-node"] |