mirror of
https://github.com/LBRYFoundation/tracker.git
synced 2025-08-31 17:31:32 +00:00
docker: move to alpine & mount config file only
This commit is contained in:
parent
7dda58a940
commit
f9ca2eb515
2 changed files with 15 additions and 15 deletions
20
Dockerfile
20
Dockerfile
|
@ -1,17 +1,18 @@
|
||||||
# vim: ft=dockerfile
|
# vim: ft=dockerfile
|
||||||
FROM golang
|
FROM golang:alpine
|
||||||
MAINTAINER Jimmy Zelinskie <jimmyzelinskie@gmail.com>
|
MAINTAINER Jimmy Zelinskie <jimmyzelinskie@gmail.com>
|
||||||
|
|
||||||
# Add files
|
# Create source directory
|
||||||
WORKDIR /go/src/github.com/chihaya/chihaya/
|
WORKDIR /go/src/github.com/chihaya/chihaya/
|
||||||
RUN mkdir -p /go/src/github.com/chihaya/chihaya/
|
RUN mkdir -p /go/src/github.com/chihaya/chihaya/
|
||||||
|
|
||||||
# Dependencies
|
# Install dependencies
|
||||||
|
RUN apk update && apk add git
|
||||||
RUN go get github.com/tools/godep
|
RUN go get github.com/tools/godep
|
||||||
ADD Godeps /go/src/github.com/chihaya/chihaya/Godeps
|
ADD Godeps /go/src/github.com/chihaya/chihaya/Godeps
|
||||||
RUN godep restore
|
RUN godep restore
|
||||||
|
|
||||||
# Add source
|
# Add source files
|
||||||
ADD *.go /go/src/github.com/chihaya/chihaya/
|
ADD *.go /go/src/github.com/chihaya/chihaya/
|
||||||
ADD api /go/src/github.com/chihaya/chihaya/api
|
ADD api /go/src/github.com/chihaya/chihaya/api
|
||||||
ADD cmd /go/src/github.com/chihaya/chihaya/cmd
|
ADD cmd /go/src/github.com/chihaya/chihaya/cmd
|
||||||
|
@ -20,14 +21,13 @@ ADD http /go/src/github.com/chihaya/chihaya/http
|
||||||
ADD stats /go/src/github.com/chihaya/chihaya/stats
|
ADD stats /go/src/github.com/chihaya/chihaya/stats
|
||||||
ADD tracker /go/src/github.com/chihaya/chihaya/tracker
|
ADD tracker /go/src/github.com/chihaya/chihaya/tracker
|
||||||
ADD udp /go/src/github.com/chihaya/chihaya/udp
|
ADD udp /go/src/github.com/chihaya/chihaya/udp
|
||||||
|
ADD example_config.json /config.json
|
||||||
|
|
||||||
# Install
|
# Install chihaya
|
||||||
RUN go install github.com/chihaya/chihaya/cmd/chihaya
|
RUN go install github.com/chihaya/chihaya/cmd/chihaya
|
||||||
|
|
||||||
# Configuration/environment
|
# Setup the entrypoint
|
||||||
VOLUME ["/config"]
|
# docker run -p 6880-6882:6880-6882 -v $PATH_TO_CONFIG_FILE:/config.json:ro quay.io/jzelinskie/chihaya:latest -v=5
|
||||||
EXPOSE 6880-6882
|
EXPOSE 6880-6882
|
||||||
|
ENTRYPOINT ["chihaya", "-config=/config.json", "-logtostderr=true"]
|
||||||
# docker run -p 6880-6882:6880-6882 -v $PATH_TO_DIR_WITH_CONF_FILE:/config:ro -e quay.io/jzelinskie/chihaya:latest -v=5
|
|
||||||
ENTRYPOINT ["chihaya", "-config=/config/config.json", "-logtostderr=true"]
|
|
||||||
CMD ["-v=5"]
|
CMD ["-v=5"]
|
||||||
|
|
10
README.md
10
README.md
|
@ -50,12 +50,12 @@ An explanation of the available keys can be found in [CONFIGURATION.md].
|
||||||
### Docker
|
### Docker
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Create a config directory and download the example config
|
# Download and edit the example config
|
||||||
mkdir $HOME/chihaya-config
|
curl -L https://raw.githubusercontent.com/chihaya/chihaya/release-v1.0/example_config.json -o config.json
|
||||||
curl -L https://raw.githubusercontent.com/chihaya/chihaya/release-v1.0/example_config.json -o $HOME/chihaya-config/config.json
|
vi config.json
|
||||||
|
|
||||||
# Run the container with the config directory mounted
|
# Run the container with the config file mounted
|
||||||
docker run -p 6880-6882:6880-6882 -v $HOME/chihaya-config:/config:ro quay.io/jzelinskie/chihaya:v1.0.0 -v=5
|
docker run -p 6880-6882:6880-6882 -v $PWD/config.json:/config.json:ro quay.io/jzelinskie/chihaya:v1.0.1 -v=5
|
||||||
```
|
```
|
||||||
|
|
||||||
## Developing Chihaya
|
## Developing Chihaya
|
||||||
|
|
Loading…
Add table
Reference in a new issue