Better docker image for the backend (#245)

* Ignore vscode settings

* Add Dockerfile for the backend

* Shrink the docker image for the backend a little more

- fix some doc
- switch the rust static builder base image to nightly
- switch 2 stage base image
- remove version label

* Switch second stage base image to scratch

* Switch to the in-house base image

* Update README.md

Co-authored-by: Maciej Hirsz <1096222+maciejhirsz@users.noreply.github.com>
This commit is contained in:
Chevdor
2020-05-27 09:08:40 +02:00
committed by GitHub
parent 246ab4e251
commit 615feb2af0
4 changed files with 34 additions and 4 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
build
target
Dockerfile
build
node_modules
.git
+3 -3
View File
@@ -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.
+3
View File
@@ -0,0 +1,3 @@
target
Dockerfile
.git
+26
View File
@@ -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"]