Skip to content

Commit 1f146f0

Browse files
committed
Added Python container
1 parent ebf07ce commit 1f146f0

File tree

6 files changed

+43
-3
lines changed

6 files changed

+43
-3
lines changed

.templates/python/Dockerfile

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM python:3
2+
3+
WORKDIR /usr/src/app
4+
5+
COPY requirements.txt ./
6+
7+
RUN pip install --no-cache-dir -r requirements.txt
8+
9+
CMD [ "python", "./app.py" ]

.templates/python/directoryfix.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# Directoryfix for python
4+
5+
if [ ! -d ./volumes/python/app ]; then
6+
sudo mkdir -p ./volumes/python/app
7+
sudo chown -R pi:pi ./volumes/python
8+
echo 'print("hello world")' >./volumes/python/app/app.py
9+
10+
fi

.templates/python/service.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
python:
2+
container_name: python
3+
build: ./services/python/.
4+
restart: unless-stopped
5+
network_mode: host
6+
volumes:
7+
- ./volumes/python/app:/usr/src/app

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ IOTstack is a builder for docker-compose to easily make and maintain IoT stacks
66

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

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

29-
3030
***
3131

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

menu.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ declare -A cont_array=(
2727
[nginx]="NGINX by linuxserver"
2828
[diyhue]="diyHue"
2929
[homebridge]="Homebridge"
30+
[python]="Python 3"
3031

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

3637
sys_arch=$(uname -m)
3738

scripts/update.sh

+14
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
1+
#!/bin/bash
2+
3+
echo "Stopping containers"
4+
docker-compose down
5+
6+
echo "Downloading latest images from docker hub ... this can take a long time"
17
docker-compose pull
8+
9+
echo "Building images if needed"
10+
docker-compose build
11+
12+
echo "Starting stack up again"
13+
docker-compose up -d
14+
15+
echo "Consider running prune-images to free up space"

0 commit comments

Comments
 (0)