consensus/docker-compose.yml
DataHoarder 1714e701de
All checks were successful
continuous-integration/drone/push Build is passing
Listen on 0.0.0.0 for tor-proxy
2024-03-01 02:51:36 +01:00

297 lines
7.5 KiB
YAML

version: "2.2"
networks:
p2pool-observer:
external: false
volumes:
p2pool:
external: false
db:
external: false
psql-run:
external: false
services:
tor:
image: goldy/tor-hidden-service:v0.4.7.12-54c0e54
tmpfs:
- /tmp
restart: always
environment:
TOR_SOCKS_PORT: 0
SERVICE1_TOR_SERVICE_HOSTS: 80:site:80,${P2POOL_EXTERNAL_PORT}:p2pool:${P2POOL_PORT}
SERVICE1_TOR_SERVICE_VERSION: '3'
SERVICE1_TOR_SERVICE_KEY: ${TOR_SERVICE_KEY}
TOR_EXTRA_OPTIONS: |
HiddenServiceNonAnonymousMode 1
HiddenServiceSingleHopMode 1
depends_on:
- site
- p2pool
networks:
- p2pool-observer
tor-proxy:
image: goldy/tor-hidden-service:v0.4.7.12-54c0e54
tmpfs:
- /tmp
restart: always
environment:
TOR_SOCKS_PORT: 0.0.0.0:9050
networks:
- p2pool-observer
site:
build:
context: ./docker/nginx
dockerfile: Dockerfile
args:
- TOR_SERVICE_ADDRESS=${TOR_SERVICE_ADDRESS}
restart: always
depends_on:
- api
- web
- daemon
tmpfs:
- /run
- /var/cache/nginx
- /tmp
networks:
- p2pool-observer
ports:
- ${SITE_PORT}:80
db:
build:
context: ./docker/postgres
dockerfile: Dockerfile
restart: always
read_only: true
shm_size: 4gb
security_opt:
- no-new-privileges:true
environment:
- POSTGRES_USER=p2pool
- POSTGRES_PASSWORD=p2pool
- POSTGRES_DB=p2pool
command: >-
postgres
-c max_connections=1000
-c shared_buffers=256MB
-c work_mem=64MB
-c temp_buffers=64MB
-c hash_mem_multiplier=2.0
-c hash_mem_multiplier=2.0
-c shared_preload_libraries='pg_stat_statements'
-c track_activity_query_size=2048
-c pg_stat_statements.track=all
-c pg_stat_statements.save=on
-c track_io_timing=on
networks:
- p2pool-observer
healthcheck:
test: [ "CMD-SHELL", "pg_isready --dbname \"postgres://p2pool:p2pool@db/p2pool\"" ]
interval: 10s
timeout: 5s
retries: 5
volumes:
- db:/var/lib/postgresql/data:rw
- psql-run:/var/run/postgresql:rw
tmpfs:
# For read-only filesystem, need to create a volume/tmpfs for PostgreSQL to run its much
# needed configuration. The read-only flag does not make volumes and tmpfs read-only.
- /tmp
- /run
- /run/postgresql
p2pool:
build:
context: ./
dockerfile: ./docker/golang/Dockerfile
args:
- BUILD_BINARY=p2pool
- GOPROXY=${GOPROXY}
restart: always
security_opt:
- no-new-privileges:true
volumes:
- p2pool:/data:rw
networks:
- p2pool-observer
working_dir: /data
ports:
- ${P2POOL_PORT}:${P2POOL_PORT}
command: >-
/usr/bin/p2pool
-debug-listen 0.0.0.0:6060
-out-peers ${P2POOL_OUT_PEERS}
-in-peers ${P2POOL_IN_PEERS}
-host ${MONEROD_HOST}
-rpc-port ${MONEROD_RPC_PORT}
-zmq-port ${MONEROD_ZMQ_PORT}
-p2p 0.0.0.0:${P2POOL_PORT}
-p2p-external-port ${P2POOL_EXTERNAL_PORT}
-api-bind '0.0.0.0:3131'
-archive /data/archive.db ${P2POOL_EXTRA_ARGS}
api:
build:
context: ./
dockerfile: ./docker/golang/Dockerfile
args:
- BUILD_BINARY=api
- GOPROXY=${GOPROXY}
restart: always
environment:
- NET_SERVICE_ADDRESS=${NET_SERVICE_ADDRESS}
- TOR_SERVICE_ADDRESS=${TOR_SERVICE_ADDRESS}
- TRANSACTION_LOOKUP_OTHER=${TRANSACTION_LOOKUP_OTHER}
depends_on:
- db
- p2pool
security_opt:
- no-new-privileges:true
networks:
- p2pool-observer
volumes:
- psql-run:/var/run/postgresql:rw
command: >-
/usr/bin/api
-debug-listen 0.0.0.0:6060
-host ${MONEROD_HOST}
-rpc-port ${MONEROD_RPC_PORT}
-api-host "http://p2pool:3131"
-db="postgres:///p2pool?host=/var/run/postgresql&user=p2pool&password=p2pool&sslmode=disable"
web:
build:
context: ./
dockerfile: ./docker/golang/Dockerfile
args:
- BUILD_BINARY=web
- GOPROXY=${GOPROXY}
restart: always
environment:
- TOR_SERVICE_ADDRESS=${TOR_SERVICE_ADDRESS}
- NET_SERVICE_ADDRESS=${NET_SERVICE_ADDRESS}
- API_URL=http://api:8080/api/
- SITE_TITLE=${SITE_TITLE}
- SITE_IRC_URL=${SITE_IRC_URL}
depends_on:
- api
security_opt:
- no-new-privileges:true
networks:
- p2pool-observer
command: >-
/usr/bin/web
-debug-listen 0.0.0.0:6060
-host ${MONEROD_HOST}
-rpc-port ${MONEROD_RPC_PORT}
daemon:
build:
context: ./
dockerfile: ./docker/golang/Dockerfile
args:
- BUILD_BINARY=daemon
- GOPROXY=${GOPROXY}
restart: always
environment:
- TOR_SERVICE_ADDRESS=${TOR_SERVICE_ADDRESS}
- NET_SERVICE_ADDRESS=${NET_SERVICE_ADDRESS}
- TRANSACTION_LOOKUP_OTHER=${TRANSACTION_LOOKUP_OTHER}
depends_on:
- db
- tor-proxy
- p2pool
security_opt:
- no-new-privileges:true
networks:
- p2pool-observer
volumes:
- psql-run:/var/run/postgresql:rw
command: >-
/usr/bin/daemon
-debug-listen 0.0.0.0:6060
-host ${MONEROD_HOST}
-rpc-port ${MONEROD_RPC_PORT}
-api-host "http://p2pool:3131"
-hook-proxy "tor-proxy:9050"
-db="postgres:///p2pool?host=/var/run/postgresql&user=p2pool&password=p2pool&sslmode=disable"
pgo-p2pool:
image: golang:1.22-alpine3.19
restart: always
environment:
- GOPROXY=${GOPROXY}
depends_on:
- p2pool
security_opt:
- no-new-privileges:true
volumes:
- ./cmd/p2pool:/data:rw
networks:
- p2pool-observer
command: >-
go run git.gammaspectra.live/P2Pool/pgo-collector@27345e42a586ccf8b3a2608cc7e91d02a9615f93
-profile-interval 1h
-profile-duration 60s
-profile-directory /data
-profile-name default.pgo
-endpoint http://p2pool:6060
pgo-daemon:
image: golang:1.22-alpine3.19
restart: always
environment:
- GOPROXY=${GOPROXY}
depends_on:
- daemon
security_opt:
- no-new-privileges:true
volumes:
- ./cmd/daemon:/data:rw
networks:
- p2pool-observer
command: >-
go run git.gammaspectra.live/P2Pool/pgo-collector@27345e42a586ccf8b3a2608cc7e91d02a9615f93
-profile-interval 1h
-profile-duration 60s
-profile-directory /data
-profile-name default.pgo
-endpoint http://daemon:6060
pgo-web:
image: golang:1.22-alpine3.19
restart: always
environment:
- GOPROXY=${GOPROXY}
depends_on:
- web
security_opt:
- no-new-privileges:true
volumes:
- ./cmd/web:/data:rw
networks:
- p2pool-observer
command: >-
go run git.gammaspectra.live/P2Pool/pgo-collector@27345e42a586ccf8b3a2608cc7e91d02a9615f93
-profile-interval 1h
-profile-duration 60s
-profile-directory /data
-profile-name default.pgo
-endpoint http://web:6060
pgo-api:
image: golang:1.22-alpine3.19
restart: always
environment:
- GOPROXY=${GOPROXY}
depends_on:
- api
security_opt:
- no-new-privileges:true
volumes:
- ./cmd/api:/data:rw
networks:
- p2pool-observer
command: >-
go run git.gammaspectra.live/P2Pool/pgo-collector@27345e42a586ccf8b3a2608cc7e91d02a9615f93
-profile-interval 1h
-profile-duration 60s
-profile-directory /data
-profile-name default.pgo
-endpoint http://api:6060