diff --git a/.dockerignore b/.dockerignore index 05eb05e..c87c8cf 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,5 @@ -build +target Dockerfile +build node_modules .git diff --git a/README.md b/README.md index 48f9632..f2c03a1 100644 --- a/README.md +++ b/README.md @@ -99,9 +99,9 @@ If you don't you can download for you OS here [Docker Desktop](https://www.docke docker-compose up --build -d ``` -- `-d` stands for detach, if you would like to see logs I recommend using [Kitmatic](https://kitematic.com/) or don't use the -d - - `--build` will build the images and rebuild, but this is not required every time - - If you want to makes UI changes, there is no need to rebuild the image as the files are being copied in via volumes. +- `-d` stands for detach, if you would like to see logs I recommend using [Kitmatic](https://kitematic.com/) or don't use the `-d` +- `--build` will build the images and rebuild, but this is not required every time +- If you want to makes UI changes, there is no need to rebuild the image as the files are being copied in via volumes. Now navigate to [http://localhost:3000](http://localhost:3000/) in your browser to view the app. diff --git a/backend/.dockerignore b/backend/.dockerignore new file mode 100644 index 0000000..8f6db69 --- /dev/null +++ b/backend/.dockerignore @@ -0,0 +1,3 @@ +target +Dockerfile +.git diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 0000000..44242e5 --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,26 @@ +#### BUILDER IMAGE -- quite big one #### +FROM paritytech/musl-ci-linux as builder +LABEL maintainer="Daniel Maricic daniel@woss.io" +LABEL description="Polkadot Telemetry backend builder image" + +ARG PROFILE=release +WORKDIR /app + +COPY . . + +RUN cargo build --${PROFILE} --bins --target x86_64-unknown-linux-musl + + +# MAIN IMAGE FOR PEOPLE TO PULL --- small one# +FROM scratch +LABEL maintainer="Daniel Maricic daniel@woss.io" +LABEL description="Polkadot Telemetry backend, static build" + +ARG PROFILE=release +WORKDIR /usr/local/bin + +COPY --from=builder /app/target/x86_64-unknown-linux-musl/$PROFILE/telemetry /usr/local/bin + +EXPOSE 8000 + +ENTRYPOINT ["telemetry"]