diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f66d762 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/.idea +/.vscode \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f8c53fc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM octoprint/octoprint AS octoprint +RUN apt update -q && \ + apt install -yq \ + cpulimit && \ + apt-get autoremove -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/lib/dpkg/status.old /var/cache/debconf/templates.dat /var/log/dpkg.log /var/log/lastlog /var/log/apt/*.log + +FROM octoprint AS mjpg-streamer-builder +WORKDIR /build +RUN apt update -q && \ + apt install -yq unzip subversion +RUN curl -s -L https://github.com/pranjalv123/mjpg-streamer-yu12/archive/refs/heads/master.zip --output mjpeg-streamer-yu12.zip && \ + unzip -q mjpeg-streamer-yu12.zip +RUN cd mjpg-streamer-yu12-master/mjpg-streamer && \ + make && \ + ls -lah + +FROM octoprint AS octoprint-mjpg-streamer +COPY --from=mjpg-streamer-builder /build/mjpg-streamer-yu12-master/mjpg-streamer/mjpg_streamer /usr/local/bin/mjpg_streamer +COPY --from=mjpg-streamer-builder /build/mjpg-streamer-yu12-master/mjpg-streamer/*.so /usr/local/lib/mjpg-streamer/ \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ce2ee06 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +lazy-deploy: + rsync -arv . printi:~/octoprint + ssh printi "cd ~/octoprint && make full-send" + +full-send: + docker compose build + docker compose down + #docker compose up -d \ No newline at end of file diff --git a/README.md b/README.md index cae9907..d10e00c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ # docker-octoprint -Dockerised Octoprint \ No newline at end of file +Dockerised Octoprint + +This is an example of how to use the Octoprint on Docker, but this specifically is flavoured around being run on the ewaste pc put together for the TechInc hackspace 3d printer "fleet".. + +flotilla? + +.. Its more like flotsam really. + +## Whats with the MJPG streamer nonsense? + +Cheap webcams (read: the ones from Action for €9.99) don't like mjpg streamer and this was a dirty hack I made ages ago to make them chooch. \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..34259c9 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +# This is an example of how to use the Octoprint on Docker, but this specifically is flavoured around +# being run on the ewaste pc put together for the TechInc hackspace 3d printer "fleet".. flotilla? .. Its more like flotsam really. + +volumes: + corexy: + +services: + corexy: + build: + context: . + target: octoprint-mjpg-streamer + restart: unless-stopped + ports: + - "3000:80" + volumes: + - corexy:/octoprint + #environment: + # - ENABLE_MJPG_STREAMER=true + devices: + - /dev/ttyACM0:/dev/ttyACM0 + # - /dev/video0:/dev/video0 \ No newline at end of file