Closed aronmgv closed 3 years ago
Vagrantfile:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/focal64"
config.disksize.size = '20GB'
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y git docker docker.io docker-compose
echo 'curl https://sh.rustup.rs -sSf | sh -s -- -y;' | su vagrant
sudo -u vagrant sh -c "echo 'source /home/vagrant/.cargo/env' > /home/vagrant/.bash_aliases"
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
sudo dpkg -i minikube_latest_amd64.deb
sudo usermod -aG docker vagrant
sudo -u vagrant git clone https://github.com/mkaczanowski/pastebin /home/vagrant/pastebin 2>/dev/null
curl -s "https://gist.githubusercontent.com/mkaczanowski/a8828bb6e17e2216afba57923b1a74e8/raw/b1a294e89a11838cfb84944d546dab998a0f25e3/docker-compose" > /home/vagrant/docker-compose.yml
# docker-compose up -d
# curl http://localhost/new -H "Host: pbin.example.com"
SHELL
end
Docker-compose:
version: "3.7"
services:
traefik:
image: "traefik:v2.3"
container_name: "traefik"
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
pastebin:
image: mkaczanowski/pastebin:latest
container_name: pastebin
restart: always
command: --address 0.0.0.0 --port 80
ports:
- "80"
labels:
- "traefik.enable=true"
- "traefik.http.routers.pastebin.entrypoints=web"
- "traefik.http.routers.pastebin.rule=Host(`pbin.example.com`)"
Test:
vagrant@ubuntu-focal:~$ curl -s http://localhost/new -H "Host: pbin.example.com" | wc -l
284
Hi,
I am struggling with docker-compose configuration for this service. I will always refuses to connect (tried
network_mode: host
- same result).. any advice please?docker-compose.yml:
Logs:
Another concern I am having is where are stored all the previous bins and server settings so I can mount it as a volume to have it persistent.
Thanks, Michal