Clear up cruft now
This commit is contained in:
parent
365d15f344
commit
d7b686dc4e
31
Makefile
31
Makefile
|
@ -1,31 +0,0 @@
|
||||||
COMPOSE_FILE := docker-compose.yml
|
|
||||||
CONFIG := $$HOME/.docker
|
|
||||||
NETWORK := proxy
|
|
||||||
STACK := traefik
|
|
||||||
SWARM_URL := tcp://swarm.autonomic.zone:2376
|
|
||||||
|
|
||||||
default: deploy
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
@docker stack deploy -c $(COMPOSE_FILE) $(STACK)
|
|
||||||
|
|
||||||
down:
|
|
||||||
@docker stack rm $(STACK)
|
|
||||||
|
|
||||||
network:
|
|
||||||
@docker network create --driver=overlay $(NETWORK)
|
|
||||||
|
|
||||||
logs:
|
|
||||||
@docker service logs -f $(STACK)_$(STACK)
|
|
||||||
|
|
||||||
config:
|
|
||||||
mkdir -vp $(CONFIG) && \
|
|
||||||
pass show docker/swarm.autonomic.zone/ca.pem > $(CONFIG)/ca.pem && \
|
|
||||||
pass show docker/swarm.autonomic.zone/cert.pem > $(CONFIG)/cert.pem && \
|
|
||||||
pass show docker/swarm.autonomic.zone/key.pem > $(CONFIG)/key.pem
|
|
||||||
|
|
||||||
context:
|
|
||||||
@docker context create swarm.autonomic.zone --docker \
|
|
||||||
"host=$(SWARM_URL),ca=$(CONFIG)/ca.pem,cert=$(CONFIG)/cert.pem,key=$(CONFIG)/key.pem"
|
|
||||||
|
|
||||||
.PHONY: deploy down network logs context
|
|
32
README.md
32
README.md
|
@ -30,33 +30,5 @@ $ curl -H Host:whoami.localhost http://127.0.0.1
|
||||||
|
|
||||||
## Production
|
## Production
|
||||||
|
|
||||||
Our [drone.autonomic.zone](https://drone.autonomic.zone/autonomic-cooperative/traefik/) configuration automatically deploys.
|
1. Our [drone.autonomic.zone](https://drone.autonomic.zone/autonomic-cooperative/traefik/) configuration automatically deploys.
|
||||||
|
1. For a manual deploy guide, see [this documentation](https://git.autonomic.zone/autonomic-cooperative/organising/wiki/working-with-docker-swarm).
|
||||||
To do it manually, you need to follow 3 steps.
|
|
||||||
|
|
||||||
1. Create the remote docker context locally.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ cp .envrc.sample .envrc
|
|
||||||
$ direnv allow # ensure password store works
|
|
||||||
$ make config
|
|
||||||
$ make context
|
|
||||||
$ docker context use swarm.autonomic.zone
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Deploy the application to the remote docker context.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ docker stack deploy \
|
|
||||||
-c docker-compose.yml \
|
|
||||||
-c docker-compose.production.yml \
|
|
||||||
traefik
|
|
||||||
```
|
|
||||||
|
|
||||||
You can track logs via `docker service logs traefik_traefik`
|
|
||||||
|
|
||||||
3. Switch back to your local context.
|
|
||||||
|
|
||||||
```
|
|
||||||
$ docker context use default
|
|
||||||
```
|
|
||||||
|
|
Reference in New Issue