From 6a71ff86ea5ec43b82873db5837c89d4fbc54e41 Mon Sep 17 00:00:00 2001 From: Pietralberto Mazza <18440657+altafan@users.noreply.github.com> Date: Fri, 9 Feb 2024 16:25:55 +0100 Subject: [PATCH] Update docker (#95) --- .dockerignore | 10 ++++++++++ Dockerfile | 23 ++++++----------------- asp/.dockerignore | 7 ------- docker-compose.yml | 13 ++++++------- 4 files changed, 22 insertions(+), 31 deletions(-) create mode 100644 .dockerignore delete mode 100755 asp/.dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3e32c0d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +.git +.github/ +website/ +noah/ +**/dist/ +**/build/ +**/*.yml +**/*.yaml +**/*.md +**/*Dockerfile diff --git a/Dockerfile b/Dockerfile index 64f67fd..191246e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -# first image used to build the sources +# First image used to build the sources FROM golang:1.21.0 AS builder ARG VERSION @@ -16,26 +16,15 @@ RUN cd asp && CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldfl # Second image, running the arkd executable FROM debian:buster-slim -# $USER name, and data $DIR to be used in the 'final' image -ARG USER=ark -ARG DIR=/home/ark +WORKDIR /app -RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates +COPY --from=builder /app/bin/* /app -COPY --from=builder /app/bin/* /usr/local/bin/ - -# NOTE: Default GID == UID == 1000 -RUN adduser --disabled-password \ - --home "$DIR/" \ - --gecos "" \ - "$USER" -USER $USER - -# Prevents 'VOLUME $DIR/.arkd/' being created as owned by 'root' -RUN mkdir -p "$DIR/.arkd/" +ENV PATH="/app:${PATH}" +ENV ARK_DATADIR=/app/data # Expose volume containing all 'arkd' data -VOLUME $DIR/.arkd/ +VOLUME /app/data ENTRYPOINT [ "arkd" ] \ No newline at end of file diff --git a/asp/.dockerignore b/asp/.dockerignore deleted file mode 100755 index 50870ba..0000000 --- a/asp/.dockerignore +++ /dev/null @@ -1,7 +0,0 @@ -*.md -build -dist -.git -.github -Dockerfile - \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 75fffa9..dddc516 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,6 @@ services: container_name: oceand image: ghcr.io/vulpemventures/oceand:latest restart: unless-stopped - user: 0:0 environment: - OCEAN_LOG_LEVEL=5 - OCEAN_NO_TLS=true @@ -17,8 +16,8 @@ services: ports: - "18000:18000" volumes: - - oceand-volume:/home/ocean/.oceand - - ocean-cli-volume:/home/ocean/.ocean-cli + - oceand:/app/data/oceand + - ocean:/app/data/ocean arkd: container_name: arkd build: @@ -33,14 +32,14 @@ services: ports: - "6000:6000" volumes: - - arkd-volume:/home/ark/.arkd + - arkd:/app/data volumes: - oceand-volume: + oceand: external: false - ocean-cli-volume: + ocean: external: false - arkd-volume: + arkd: external: false networks: