make docker-entrypoint actually pass env var -_-;; and update README about docker

This commit is contained in:
Dan Ballard 2018-11-02 17:17:16 -07:00
부모 b145420f21
커밋 09fdb05168
4개의 변경된 파일23개의 추가작업 그리고 6개의 파일을 삭제

파일 보기

@ -55,7 +55,6 @@ RUN apk --no-cache add --update \
COPY --from=tor-build-stage /usr/local/ /usr/local/
# Create an unprivileged tor user
#RUN addgroup -g 19001 -S $TOR_USER && adduser -u 19001 -G $TOR_USER -S $TOR_USER
RUN addgroup -S $TOR_USER && adduser -G $TOR_USER -S $TOR_USER && adduser -G _tor -S cwtchd && mkdir /run/tor
# Copy Tor configuration file

파일 보기

@ -32,8 +32,27 @@ Development and Contributing information in [CONTRIBUTING.md](https://git.openpr
#### Docker
This repository contains a `Dockerfile` allowing you to build and run the server as a [docker](https://www.docker.com/) container.
To get started issue `docker build -t cwtch:latest`, this will create 2 temporary docker containers, one to build the Tor daemon and one to build Cwtch. The compiled binaries will then be bundled into a new image and tagged as `cwtch:latest`.
To get started issue `docker build -t openpriv/cwtch-server:latest`, this will create 2 temporary docker containers, one to build the Tor daemon and one to build Cwtch. The compiled binaries will then be bundled into a new image and tagged as `openpriv/cwtch-server:latest`.
To run Cwtch in the foreground execute `docker run cwtch:latest`, you will see a small amount of output from Tor and then Cwtch will output your server address. When you `Ctrl + C` the container will terminate. To run Cwtch in the background execute `docker run --name my-cwtch-server -d cwtch:latest`. To get your Cwtch server address issue `docker logs my-cwtch-server`.
To run Cwtch in the foreground execute `docker run openpriv/cwtch-server:latest`, you will see a small amount of output from Tor and then Cwtch will output your server address. When you `Ctrl + C` the container will terminate. To run Cwtch in the background execute `docker run --name my-cwtch-server -d openpriv/cwtch-server:latest`. To get your Cwtch server address issue `docker logs my-cwtch-server`.
The image creates 3 volumes, for /etc/cwtch, /etc/tor, /var/lib/tor
##### Upgrading
To upgrade with continuity
```
# Stop current container/service
docker stop my-cwtch-server
docker pull openpriv/cwtch-server
# Create a new container and copy the volumes (cwtch/onion keys, message store)
docker create --name my-cwtch-server-2 --volumes-from my-cwtch-server openpriv/cwtch-server:latest
# Resume service with the new container
docker start my-cwtch-server-2
```
![](https://git.openprivacy.ca/avatars/5?s=140)

파일 보기

@ -30,5 +30,4 @@ if [ -z "${CWTCH_CONFIG_DIR}" ]; then
fi
#Run cwtch (or whatever the user passed)
exec "$@"
#$@
CWTCH_CONFIG_DIR=$CWTCH_CONFIG_DIR exec "$@"

파일 보기

@ -40,7 +40,7 @@ func (config *Config) Save(dir, filename string) {
// LoadConfig loads a Config from a json file specified by filename
func LoadConfig(configDir, filename string) Config {
log.Printf("Loading config from %s\n", filename)
log.Printf("Loading config from %s\n", path.Join(configDir, filename))
config := Config{}
config.ConfigDir = configDir
config.MaxBufferLines = 100000