It was a mess.
.htaccess
RewriteRule proxy to Node.js appsgit clone REPO ~/build/
→ npm install
→ grunt
→ jekyll build
, all in the same user account hosting the files(of course)
Docker...
Host OS: Container Linux
I configured it to perform updates between 11pm and 12am
Cloud Platform: DigitalOcean
Sidenote: Cost us much less than our previous host.
Portainer...
Kubernetes is awesome but not useful for this.
docker run --detach \
--restart unless-stopped \
--network management \
--publish 9000:9000 \
--volume /data/portainer:/data \
--volume /var/run/docker.sock:/var/run/docker.sock \
--name portainer \
portainer
docker run --detach \
--restart unless-stopped \
--network management \
--publish 5000:127.0.0.1:5001 \
--volume /var/lib/registry:/data/registry \
--name registry \
registry:2
Benefits:
Problems:
What we have so far:
Unlimited private repositories and users! Thanks, GitHub!
docker build
and docker push
Drone is a simple CI/CD platform written in Go. (I love Go)
docker-compose
-like syntaxInstalling Drone is simple
drone/drone:0.8
, mount /var/lib/drone
, set enviromental variables, publish ports 80
drone/agent:0.8
, mount /var/run/docker.sock
, set enviromental variables
docker-compose
Check out http://docs.drone.io
Enable Drone on your project
Then, write a .drone.yml
file.
cat ~/appventure-nush/caddy/.drone.yml
pipeline:
test:
image: 127.0.0.1:5001/caddy
commands:
- caddy -validate
publish:
image: plugins/docker # Docker plugin builds
# and publishes images
registry: registry:5000 # Not recommended
insecure: true
repo: registry:5000/caddy
tags:
- latest
cat ~/appventure-nush/some-android-app/.drone.yml
pipeline:
build:
image: 127.0.0.1:5001/builder-android
release:
image: plugins/github-release
secrets: [ github_token ]
files: app/build/outputs/apk/app-debug.apk
when:
event: tag
Two networks:
Caddy reverse proxies services on the primary network, and terminates TLS using Let's Encrypt