Support docker (#91)

* Move dockerifle and add compose

* Use named volumes
This commit is contained in:
Pietralberto Mazza
2024-02-09 11:24:48 +01:00
committed by GitHub
parent 287db4e08a
commit 2cffc2907c
2 changed files with 50 additions and 2 deletions

4
asp/Dockerfile → Dockerfile Executable file → Normal file
View File

@@ -1,5 +1,5 @@
# first image used to build the sources
FROM golang:1.21 AS builder
FROM golang:1.21.0 AS builder
ARG VERSION
ARG COMMIT
@@ -11,7 +11,7 @@ WORKDIR /app
COPY . .
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-X 'main.Version=${COMMIT}' -X 'main.Commit=${COMMIT}' -X 'main.Date=${COMMIT}'" -o bin/arkd cmd/arkd/main.go
RUN cd asp && CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-X 'main.Version=${COMMIT}' -X 'main.Commit=${COMMIT}' -X 'main.Date=${COMMIT}'" -o ../bin/arkd cmd/arkd/main.go
# Second image, running the arkd executable
FROM debian:buster-slim

48
docker-compose.yml Normal file
View File

@@ -0,0 +1,48 @@
version: "3.7"
services:
oceand:
container_name: oceand
image: ghcr.io/vulpemventures/oceand:latest
restart: unless-stopped
user: 0:0
environment:
- OCEAN_LOG_LEVEL=5
- OCEAN_NO_TLS=true
- OCEAN_NO_PROFILER=true
- OCEAN_ELECTRUM_URL=ssl://blockstream.info:465
- OCEAN_NETWORK=testnet
- OCEAN_UTXO_EXPIRY_DURATION_IN_SECONDS=60
- OCEAN_DB_TYPE=badger
ports:
- "18000:18000"
volumes:
- oceand-volume:/home/ocean/.oceand
- ocean-cli-volume:/home/ocean/.ocean-cli
arkd:
container_name: arkd
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
- oceand
environment:
- ARK_WALLET_ADDR=oceand:18000
- ARK_ROUND_INTERVAL=10
ports:
- "6000:6000"
volumes:
- arkd-volume:/home/ark/.arkd
volumes:
oceand-volume:
external: false
ocean-cli-volume:
external: false
arkd-volume:
external: false
networks:
default:
name: ark