Skip to content

MTWiley/Octoprint-On-Docker

Repository files navigation

Install Docker

Setup folder to store data you want to be persistent

mkdir /docker/

mjpg-streamer

Start the mjpg-streamer container

docker run -d \
  --restart=always \
  -p 8081:80 \
  --device=/dev/video0 \
  --name=mjpg-streamer \
  mrwyss/mjpg-streamer

Octoprint

Create the persistent directories on the docker machine

mkdir /docker/octoprint
mkdir /docker/octoprint/data

Start the octoprint container

docker run -d \
  --restart=always \
  -p 5000:5000 \
  --device=/dev/ttyUSB0 \
  -v /docker/octoprint/data/:/data \
  --name=doctoprint \
  mtwiley/doctoprint

HAProxy

Create the directories on the docker machine

mkdir /docker/haproxy/
mkdir /docker/haproxy/config
mkdir /docker/haproxy/letsencrypt
mkdir /docker/haproxy/certs.d

Copy in the haproxy.cfg file

cp $ThisRepoLocation/haproxy.cfg /docker/haproxy/config/

Start the haproxy container

docker run -d \
  --restart=always \
  --name haproxy-certbot \
  --cap-add=NET_ADMIN
  -p 80:80 \
  -p 443:443 \
  -v /docker/haproxy/config:/config \
  -v /docker/haproxy/letsencrypt:/etc/letsencrypt \
  -v /docker/haproxy/certs.d:/usr/local/etc/haproxy/certs.d \
  nmarus/haproxy-certbot

Get Initial Certificate

docker exec haproxy-certbot certbot-certonly \
  --domain wiley-apex.ddns.net \
  --email [email protected]

Pickup Changes to Certs/haproxy.cfg

docker exec haproxy-certbot haproxy-refresh

Renew Certificate

docker exec haproxy-certbot certbot-renew

Backup/Restore

Backup

tar -zcvf $(date +%Y-%m-%d)-octoprint_data.tar.gz -C /docker/octoprint/data .

Restore

tar -xvf YYYY-MM-DD-octoprint_data.tar.gz -C /docker/octoprint/data

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published