docker-compose setup
This commit is contained in:
parent
9f16c2b43d
commit
69d2c980ac
6
.dockerignore
Normal file
6
.dockerignore
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.git/
|
||||||
|
.env
|
||||||
|
.env.example
|
||||||
|
.gitignore
|
||||||
|
docker-compose.override.yml
|
||||||
|
README.md
|
21
.env.example
Normal file
21
.env.example
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#GOPROXY=direct
|
||||||
|
|
||||||
|
# IRC host/port to connect to
|
||||||
|
IRC_HOST=irc.libera.chat
|
||||||
|
IRC_PORT=6697
|
||||||
|
|
||||||
|
# Bot configuration
|
||||||
|
BOT_NICK=
|
||||||
|
BOT_USER=
|
||||||
|
# ChanServ password
|
||||||
|
BOT_PASSWORD=
|
||||||
|
|
||||||
|
# A list of #CHANNEL,NAME,API_ENDPOINT separated by; for example: #p2pool-main,Main,https://p2pool.observer;#p2pool-mini,Mini,https://mini.p2pool.observer
|
||||||
|
CHANNELS=
|
||||||
|
|
||||||
|
# Pleroma host and cookie if any
|
||||||
|
PLEROMA_HOST=
|
||||||
|
PLEROMA_COOKIE=
|
||||||
|
|
||||||
|
# Extra command line arguments like SSL
|
||||||
|
EXTRA_ARGS=-irc-ssl
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1 +1,3 @@
|
||||||
.idea
|
.idea
|
||||||
|
.env.example
|
||||||
|
docker-compose.override.yml
|
23
Dockerfile
Normal file
23
Dockerfile
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
FROM golang:1.20-alpine
|
||||||
|
|
||||||
|
|
||||||
|
ENV CFLAGS="-march=native -Ofast"
|
||||||
|
ENV CXXFLAGS="-march=native -Ofast"
|
||||||
|
ENV LDFLAGS="-flto"
|
||||||
|
ENV CGO_CFLAGS="-march=native -Ofast"
|
||||||
|
|
||||||
|
ENV CGO_ENABLED="0"
|
||||||
|
|
||||||
|
WORKDIR /usr/src/p2pool-observer-bot
|
||||||
|
|
||||||
|
ARG GOPROXY=""
|
||||||
|
ENV GOPROXY=${GOPROXY}
|
||||||
|
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download -x && go mod verify
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN go build -buildvcs=false -trimpath -v -o /usr/bin/bot git.gammaspectra.live/P2Pool/p2pool-observer-bot
|
||||||
|
|
||||||
|
WORKDIR /data
|
33
docker-compose.yml
Normal file
33
docker-compose.yml
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
version: "2.2"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
p2pool-observer-bot:
|
||||||
|
external: false
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
data:
|
||||||
|
external: false
|
||||||
|
services:
|
||||||
|
bot:
|
||||||
|
build:
|
||||||
|
context: ./
|
||||||
|
dockerfile: ./Dockerfile
|
||||||
|
args:
|
||||||
|
- GOPROXY=${GOPROXY}
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
- BOT_PASSWORD=${BOT_PASSWORD}
|
||||||
|
- PLEROMA_COOKIE=${PLEROMA_COOKIE}
|
||||||
|
security_opt:
|
||||||
|
- no-new-privileges:true
|
||||||
|
networks:
|
||||||
|
- p2pool-observer-bot
|
||||||
|
command: >-
|
||||||
|
/usr/bin/bot
|
||||||
|
-irc-host "${IRC_HOST}"
|
||||||
|
-irc-port "${IRC_PORT}"
|
||||||
|
-bot-nick "${BOT_NICK}"
|
||||||
|
-bot-user "${BOT_USER}"
|
||||||
|
-pleroma-host "${PLEROMA_HOST}"
|
||||||
|
-channels "${CHANNELS}"
|
||||||
|
${P2POOL_EXTRA_ARGS}
|
Loading…
Reference in a new issue