From 0fb89d19ecb8f3192fa5192412111a136b6041ff Mon Sep 17 00:00:00 2001 From: piotrMocz Date: Wed, 24 Jan 2024 13:06:27 +0100 Subject: [PATCH 1/2] Docker config --- .dockerignore | 1 + Dockerfile | 20 ++++---------------- config.yml | 2 +- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/.dockerignore b/.dockerignore index 2f7896d..2233067 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,2 @@ target/ +Dockerfile \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 3e3ff73..7198be0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,33 +1,21 @@ -FROM rust:buster as builder +FROM rust:1.74-buster as builder WORKDIR /app -COPY . . +ADD . . RUN cargo build --release --verbose # ============= -FROM phusion/baseimage:focal-1.2.0 -LABEL maintainer="hello@acala.network" +FROM ubuntu:22.04 RUN useradd -m -u 1000 -U -s /bin/sh -d /app docker WORKDIR /app -RUN apt-get update && apt-get install tini - COPY --from=builder /app/target/release/subway /usr/local/bin COPY ./config.yml /app/config.yml -# checks -RUN ldd /usr/local/bin/subway && \ - /usr/local/bin/subway --version - -# Shrinking -RUN rm -rf /usr/lib/python* && \ - rm -rf /usr/sbin /usr/share/man - USER docker -EXPOSE 9944 -ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/subway"] +ENTRYPOINT ["/usr/local/bin/subway"] diff --git a/config.yml b/config.yml index 3d143c5..a0558b6 100644 --- a/config.yml +++ b/config.yml @@ -33,7 +33,7 @@ extensions: # WARNING: Use with caution, as this xff header can be forged. use_xff: true # default is false prometheus: - port: 9615 + port: 9616 label: "dev" middlewares: From 6323491a6f5a86d45809d04e4561d84bf9a4060d Mon Sep 17 00:00:00 2001 From: piotrMocz Date: Fri, 26 Jan 2024 12:43:03 +0100 Subject: [PATCH 2/2] Update .dockerignore --- .dockerignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 2233067..342ee83 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,2 @@ target/ -Dockerfile \ No newline at end of file +Dockerfile