Skip to content

Commit

Permalink
Added Python container
Browse files Browse the repository at this point in the history
  • Loading branch information
gcgarner committed Dec 19, 2019
1 parent ebf07ce commit 1f146f0
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .templates/python/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:3

WORKDIR /usr/src/app

COPY requirements.txt ./

RUN pip install --no-cache-dir -r requirements.txt

CMD [ "python", "./app.py" ]
10 changes: 10 additions & 0 deletions .templates/python/directoryfix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# Directoryfix for python

if [ ! -d ./volumes/python/app ]; then
sudo mkdir -p ./volumes/python/app
sudo chown -R pi:pi ./volumes/python
echo 'print("hello world")' >./volumes/python/app/app.py

fi
7 changes: 7 additions & 0 deletions .templates/python/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
python:
container_name: python
build: ./services/python/.
restart: unless-stopped
network_mode: host
volumes:
- ./volumes/python/app:/usr/src/app
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ IOTstack is a builder for docker-compose to easily make and maintain IoT stacks

The bulk of the README has moved to the Wiki. Please check it out [here](https://github.com/gcgarner/IOTstack/wiki)

* 2019-12-19 Added python container, tweaked update script
* 2019-12-12 modified zigbee2mqtt template file
* 2019-12-12 Added Function to add custom containers to the stack
* 2019-12-12 PR cmskedgell: Added Homebridge
Expand All @@ -26,7 +27,6 @@ The bulk of the README has moved to the Wiki. Please check it out [here](https:/
* Node-RED: serial port. New template adds privileged which allows acces to serial devices
* EspurinoHub: is available for testing see wiki entry


***

## Highlighted topics
Expand All @@ -42,7 +42,6 @@ The bulk of the README has moved to the Wiki. Please check it out [here](https:/
* reverse proxy is now next on the list, I cant keep up with the ports
* Detection of arhcitecture for seperate stack options for amd64, armhf, i386
* autocleanup of backups on cloud
* python container
* Gitea (in testing branch)
* OwnCloud

Expand Down
3 changes: 2 additions & 1 deletion menu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ declare -A cont_array=(
[nginx]="NGINX by linuxserver"
[diyhue]="diyHue"
[homebridge]="Homebridge"
[python]="Python 3"

)
declare -a armhf_keys=("portainer" "nodered" "influxdb" "grafana" "mosquitto" "telegraf" "mariadb" "postgres"
"adminer" "openhab" "zigbee2mqtt" "pihole" "plex" "tasmoadmin" "rtl_433" "espruinohub"
"motioneye" "webthings_gateway" "blynk_server" "nextcloud" "diyhue" "homebridge")
"motioneye" "webthings_gateway" "blynk_server" "nextcloud" "diyhue" "homebridge" "python")

sys_arch=$(uname -m)

Expand Down
14 changes: 14 additions & 0 deletions scripts/update.sh
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
#!/bin/bash

echo "Stopping containers"
docker-compose down

echo "Downloading latest images from docker hub ... this can take a long time"
docker-compose pull

echo "Building images if needed"
docker-compose build

echo "Starting stack up again"
docker-compose up -d

echo "Consider running prune-images to free up space"

0 comments on commit 1f146f0

Please sign in to comment.