add init scripts

This commit is contained in:
Kevin Davis 2019-11-25 14:24:46 -05:00
parent 1673675b66
commit ede5a96c0f
4 changed files with 68 additions and 0 deletions

27
Dockerfile Normal file
View File

@ -0,0 +1,27 @@
FROM golang:alpine AS build-env
# Set up dependencies
# bash for debugging
# git, make for installation
# libc-dev, gcc, linux-headers, eudev-dev are used for cgo and ledger installation (possibly)
RUN apk add bash git make libc-dev gcc linux-headers eudev-dev jq
# Set working directory for the build
WORKDIR /root/kava
# default home directory is /root
COPY go.mod .
COPY go.sum .
RUN go mod download
# Add source files
COPY . .
# Install kvd, kvcli
#ENV LEDGER_ENABLED False
RUN make install
# Run kvd by default, omit entrypoint to ease using container with kvcli
CMD ["kvd"]

6
contrib/init/README.md Normal file
View File

@ -0,0 +1,6 @@
Sample configuration files for:
```
SystemD: kvd.service
macOS: io.kava.kvd.plist
```

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>io.kava.kvd</string>
<key>ProgramArguments</key>
<array>
<!--Assumes user is "kava"-->
<string>/Users/kava/go/bin/kvd</string>
<string>start</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>kava</string>
</dict>
</plist>
QuantaFrontier.com

15
contrib/init/kvd.service Normal file
View File

@ -0,0 +1,15 @@
[Unit]
Description=Kava daemon
After=network-online.target
[Service]
# Run as kava:kava
User=kava
ExecStart=/home/kava/go/bin/kvd start
Restart=on-failure
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target