Fix docker-compose.yml, allow to run from dockerhub or build own image

This commit is contained in:
Julien Maulny 2019-11-14 11:52:37 +00:00
parent 17e43fa504
commit e76ac3a3f9
No known key found for this signature in database
GPG Key ID: F0D571B9763B99D4
3 changed files with 36 additions and 9 deletions

View File

@ -11,6 +11,21 @@ magneticow:
go-bindata -o="cmd/magneticow/bindata.go" -prefix="cmd/magneticow/data/" cmd/magneticow/data/... go-bindata -o="cmd/magneticow/bindata.go" -prefix="cmd/magneticow/data/" cmd/magneticow/data/...
go install --tags fts5 "-ldflags=-s -w -X main.compiledOn=`date -u +%Y-%m-%dT%H:%M:%SZ`" ./cmd/magneticow go install --tags fts5 "-ldflags=-s -w -X main.compiledOn=`date -u +%Y-%m-%dT%H:%M:%SZ`" ./cmd/magneticow
.PHONY: docker
docker: docker_up docker_logs
.PHONY: docker_up
docker_up:
docker-compose up -d
.PHONY: docker_down
docker_down:
docker-compose down
.PHONY: docker_logs
docker_logs:
docker-compose logs -ft --tail=10
image-magneticod: image-magneticod:
docker build -t boramalper/magneticod -f Dockerfile.magneticod . docker build -t boramalper/magneticod -f Dockerfile.magneticod .

View File

@ -71,7 +71,25 @@ for torrents in the network, hence removing the need for centralised torrent web
2. Install **magneticow** afterwards by following its 2. Install **magneticow** afterwards by following its
[installation instructions](cmd/magneticow/README.md). [installation instructions](cmd/magneticow/README.md).
*Alternatively*, just grab it from [Docker Hub](https://hub.docker.com/u/boramalper)! ### Docker
Run **magneticod** and **magneticow** with:
``` bash
make docker
```
It will run magnetico from already built image on [Docker Hub](https://hub.docker.com/u/boramalper)!
You should access magneticow at <http://localhost:8080>.
To build fresh images from source, first run:
``` bash
make image
```
Then run `make docker`. It ensures you run updated images of magnetico.
## License ## License

View File

@ -2,19 +2,13 @@ version: "2"
services: services:
magneticod: magneticod:
build: image: boramalper/magneticod
image: boramalper/magneticod
# context: .
# dockerfile: Dockerfile.magneticod
volumes: volumes:
- magneticod-data:/root/.local/share/magneticod - magneticod-data:/root/.local/share/magneticod
- magneticod-config:/root/.config/magneticod - magneticod-config:/root/.config/magneticod
magneticow: magneticow:
build: image: boramalper/magneticow
image: boramalper/magneticow
# context: .
# dockerfile: Dockerfile.magneticow
volumes: volumes:
- magneticod-data:/root/.local/share/magneticod - magneticod-data:/root/.local/share/magneticod
depends_on: depends_on: