Merge pull request #4294 from mempool/knorrium/docker_updates
Docker updates
This commit is contained in:
commit
b7919afd2f
8
.github/workflows/on-tag.yml
vendored
8
.github/workflows/on-tag.yml
vendored
@ -68,17 +68,17 @@ jobs:
|
|||||||
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
|
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
|
||||||
|
|
||||||
- name: Checkout project
|
- name: Checkout project
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Init repo for Dockerization
|
- name: Init repo for Dockerization
|
||||||
run: docker/init.sh "$TAG"
|
run: docker/init.sh "$TAG"
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v3
|
||||||
id: qemu
|
id: qemu
|
||||||
|
|
||||||
- name: Setup Docker buildx action
|
- name: Setup Docker buildx action
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
id: buildx
|
id: buildx
|
||||||
|
|
||||||
- name: Available platforms
|
- name: Available platforms
|
||||||
@ -98,7 +98,7 @@ jobs:
|
|||||||
docker buildx build \
|
docker buildx build \
|
||||||
--cache-from "type=local,src=/tmp/.buildx-cache" \
|
--cache-from "type=local,src=/tmp/.buildx-cache" \
|
||||||
--cache-to "type=local,dest=/tmp/.buildx-cache" \
|
--cache-to "type=local,dest=/tmp/.buildx-cache" \
|
||||||
--platform linux/amd64,linux/arm64,linux/arm/v7 \
|
--platform linux/amd64,linux/arm64 \
|
||||||
--tag ${{ secrets.DOCKER_HUB_USER }}/${{ matrix.service }}:$TAG \
|
--tag ${{ secrets.DOCKER_HUB_USER }}/${{ matrix.service }}:$TAG \
|
||||||
--tag ${{ secrets.DOCKER_HUB_USER }}/${{ matrix.service }}:latest \
|
--tag ${{ secrets.DOCKER_HUB_USER }}/${{ matrix.service }}:latest \
|
||||||
--output "type=registry" ./${{ matrix.service }}/ \
|
--output "type=registry" ./${{ matrix.service }}/ \
|
||||||
|
47
GNUmakefile
47
GNUmakefile
@ -1,47 +0,0 @@
|
|||||||
# If you see pwd_unknown showing up check permissions
|
|
||||||
PWD ?= pwd_unknown
|
|
||||||
|
|
||||||
# DATABASE DEPLOY FOLDER CONFIG - default ./data
|
|
||||||
ifeq ($(data),)
|
|
||||||
DATA := data
|
|
||||||
export DATA
|
|
||||||
else
|
|
||||||
DATA := $(data)
|
|
||||||
export DATA
|
|
||||||
endif
|
|
||||||
|
|
||||||
.PHONY: help
|
|
||||||
help:
|
|
||||||
@echo ''
|
|
||||||
@echo ''
|
|
||||||
@echo ' Usage: make [COMMAND]'
|
|
||||||
@echo ''
|
|
||||||
@echo ' make all # build init mempool and electrs'
|
|
||||||
@echo ' make init # setup some useful configs'
|
|
||||||
@echo ' make mempool # build q dockerized mempool.space'
|
|
||||||
@echo ' make electrs # build a docker electrs image'
|
|
||||||
@echo ''
|
|
||||||
|
|
||||||
.PHONY: init
|
|
||||||
init:
|
|
||||||
@echo ''
|
|
||||||
mkdir -p $(DATA) $(DATA)/mysql $(DATA)/mysql/data
|
|
||||||
#REF: https://github.com/mempool/mempool/blob/master/docker/README.md
|
|
||||||
cat docker/docker-compose.yml > docker-compose.yml
|
|
||||||
cat backend/mempool-config.sample.json > backend/mempool-config.json
|
|
||||||
.PHONY: mempool
|
|
||||||
mempool: init
|
|
||||||
@echo ''
|
|
||||||
docker-compose up --force-recreate --always-recreate-deps
|
|
||||||
@echo ''
|
|
||||||
.PHONY: electrs
|
|
||||||
electrum:
|
|
||||||
#REF: https://hub.docker.com/r/beli/electrum
|
|
||||||
@echo ''
|
|
||||||
docker build -f docker/electrum/Dockerfile .
|
|
||||||
@echo ''
|
|
||||||
.PHONY: all
|
|
||||||
all: init
|
|
||||||
make mempool
|
|
||||||
#######################
|
|
||||||
-include Makefile
|
|
@ -1,4 +1,4 @@
|
|||||||
FROM node:16.16.0-buster-slim AS builder
|
FROM node:20.8.0-buster-slim AS builder
|
||||||
|
|
||||||
ARG commitHash
|
ARG commitHash
|
||||||
ENV MEMPOOL_COMMIT_HASH=${commitHash}
|
ENV MEMPOOL_COMMIT_HASH=${commitHash}
|
||||||
@ -17,7 +17,7 @@ ENV PATH="/root/.cargo/bin:$PATH"
|
|||||||
RUN npm install --omit=dev --omit=optional
|
RUN npm install --omit=dev --omit=optional
|
||||||
RUN npm run package
|
RUN npm run package
|
||||||
|
|
||||||
FROM node:16.16.0-buster-slim
|
FROM node:20.8.0-buster-slim
|
||||||
|
|
||||||
WORKDIR /backend
|
WORKDIR /backend
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ __MEMPOOL_SERVICES_API__=${MEMPOOL_SERVICES_API:=""}
|
|||||||
__MEMPOOL_SERVICES_ACCELERATIONS__=${MEMPOOL_SERVICES_ACCELERATIONS:=false}
|
__MEMPOOL_SERVICES_ACCELERATIONS__=${MEMPOOL_SERVICES_ACCELERATIONS:=false}
|
||||||
|
|
||||||
# REDIS
|
# REDIS
|
||||||
__REDIS_ENABLED__=${REDIS_ENABLED:=true}
|
__REDIS_ENABLED__=${REDIS_ENABLED:=false}
|
||||||
__REDIS_UNIX_SOCKET_PATH__=${REDIS_UNIX_SOCKET_PATH:=true}
|
__REDIS_UNIX_SOCKET_PATH__=${REDIS_UNIX_SOCKET_PATH:=true}
|
||||||
|
|
||||||
mkdir -p "${__MEMPOOL_CACHE_DIR__}"
|
mkdir -p "${__MEMPOOL_CACHE_DIR__}"
|
||||||
|
@ -38,7 +38,7 @@ services:
|
|||||||
MYSQL_USER: "mempool"
|
MYSQL_USER: "mempool"
|
||||||
MYSQL_PASSWORD: "mempool"
|
MYSQL_PASSWORD: "mempool"
|
||||||
MYSQL_ROOT_PASSWORD: "admin"
|
MYSQL_ROOT_PASSWORD: "admin"
|
||||||
image: mariadb:10.5.8
|
image: mariadb:10.5.21
|
||||||
user: "1000:1000"
|
user: "1000:1000"
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
stop_grace_period: 1m
|
stop_grace_period: 1m
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
FROM ubuntu:18.04
|
|
||||||
MAINTAINER mempool.space developers
|
|
||||||
EXPOSE 50002
|
|
||||||
|
|
||||||
# runs as UID 1000 GID 1000 inside the container
|
|
||||||
|
|
||||||
ENV VERSION 4.0.9
|
|
||||||
RUN set -x \
|
|
||||||
&& apt-get update \
|
|
||||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gpg gpg-agent dirmngr \
|
|
||||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends wget xpra python3-pyqt5 python3-wheel python3-pip python3-setuptools libsecp256k1-0 libsecp256k1-dev python3-numpy python3-dev build-essential \
|
|
||||||
&& wget -O /tmp/Electrum-${VERSION}.tar.gz https://download.electrum.org/${VERSION}/Electrum-${VERSION}.tar.gz \
|
|
||||||
&& wget -O /tmp/Electrum-${VERSION}.tar.gz.asc https://download.electrum.org/${VERSION}/Electrum-${VERSION}.tar.gz.asc \
|
|
||||||
&& gpg --keyserver keys.gnupg.net --recv-keys 6694D8DE7BE8EE5631BED9502BD5824B7F9470E6 \
|
|
||||||
&& gpg --verify /tmp/Electrum-${VERSION}.tar.gz.asc /tmp/Electrum-${VERSION}.tar.gz \
|
|
||||||
&& pip3 install /tmp/Electrum-${VERSION}.tar.gz \
|
|
||||||
&& test -f /usr/local/bin/electrum \
|
|
||||||
&& rm -vrf /tmp/Electrum-${VERSION}.tar.gz /tmp/Electrum-${VERSION}.tar.gz.asc ${HOME}/.gnupg \
|
|
||||||
&& apt-get purge --autoremove -y python3-wheel python3-pip python3-setuptools python3-dev build-essential libsecp256k1-dev curl gpg gpg-agent dirmngr \
|
|
||||||
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
|
|
||||||
&& useradd -d /home/mempool -m mempool \
|
|
||||||
&& mkdir /electrum \
|
|
||||||
&& ln -s /electrum /home/mempool/.electrum \
|
|
||||||
&& chown mempool:mempool /electrum
|
|
||||||
|
|
||||||
USER mempool
|
|
||||||
ENV HOME /home/mempool
|
|
||||||
WORKDIR /home/mempool
|
|
||||||
VOLUME /electrum
|
|
||||||
|
|
||||||
CMD ["/usr/bin/xpra", "start", ":100", "--start-child=/usr/local/bin/electrum", "--bind-tcp=0.0.0.0:50002","--daemon=yes", "--notifications=no", "--mdns=no", "--pulseaudio=no", "--html=off", "--speaker=disabled", "--microphone=disabled", "--webcam=no", "--printing=no", "--dbus-launch=", "--exit-with-children"]
|
|
||||||
ENTRYPOINT ["electrum"]
|
|
@ -1,4 +1,4 @@
|
|||||||
FROM node:16.16.0-buster-slim AS builder
|
FROM node:20.8.0-buster-slim AS builder
|
||||||
|
|
||||||
ARG commitHash
|
ARG commitHash
|
||||||
ENV DOCKER_COMMIT_HASH=${commitHash}
|
ENV DOCKER_COMMIT_HASH=${commitHash}
|
||||||
@ -13,7 +13,7 @@ RUN npm install --omit=dev --omit=optional
|
|||||||
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
FROM nginx:1.17.8-alpine
|
FROM nginx:1.24.0-alpine
|
||||||
|
|
||||||
WORKDIR /patch
|
WORKDIR /patch
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ __AUDIT__=${AUDIT:=false}
|
|||||||
__MAINNET_BLOCK_AUDIT_START_HEIGHT__=${MAINNET_BLOCK_AUDIT_START_HEIGHT:=0}
|
__MAINNET_BLOCK_AUDIT_START_HEIGHT__=${MAINNET_BLOCK_AUDIT_START_HEIGHT:=0}
|
||||||
__TESTNET_BLOCK_AUDIT_START_HEIGHT__=${TESTNET_BLOCK_AUDIT_START_HEIGHT:=0}
|
__TESTNET_BLOCK_AUDIT_START_HEIGHT__=${TESTNET_BLOCK_AUDIT_START_HEIGHT:=0}
|
||||||
__SIGNET_BLOCK_AUDIT_START_HEIGHT__=${SIGNET_BLOCK_AUDIT_START_HEIGHT:=0}
|
__SIGNET_BLOCK_AUDIT_START_HEIGHT__=${SIGNET_BLOCK_AUDIT_START_HEIGHT:=0}
|
||||||
|
__ACCELERATOR__=${ACCELERATOR:=false}
|
||||||
__HISTORICAL_PRICE__=${HISTORICAL_PRICE:=true}
|
__HISTORICAL_PRICE__=${HISTORICAL_PRICE:=true}
|
||||||
|
|
||||||
# Export as environment variables to be used by envsubst
|
# Export as environment variables to be used by envsubst
|
||||||
@ -65,6 +66,7 @@ export __AUDIT__
|
|||||||
export __MAINNET_BLOCK_AUDIT_START_HEIGHT__
|
export __MAINNET_BLOCK_AUDIT_START_HEIGHT__
|
||||||
export __TESTNET_BLOCK_AUDIT_START_HEIGHT__
|
export __TESTNET_BLOCK_AUDIT_START_HEIGHT__
|
||||||
export __SIGNET_BLOCK_AUDIT_START_HEIGHT__
|
export __SIGNET_BLOCK_AUDIT_START_HEIGHT__
|
||||||
|
export __ACCELERATOR__
|
||||||
export __HISTORICAL_PRICE__
|
export __HISTORICAL_PRICE__
|
||||||
|
|
||||||
folder=$(find /var/www/mempool -name "config.js" | xargs dirname)
|
folder=$(find /var/www/mempool -name "config.js" | xargs dirname)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user