diff --git a/Dockerfile.template b/Dockerfile.template index 2dc2f2b..82f88e5 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -1,11 +1,13 @@ FROM balenalib/%%RESIN_MACHINE_NAME%%-alpine:latest -RUN apk update && apk add bash py-pip lockfile-progs --no-cache && \ +WORKDIR /usr/src/app + +RUN apk update && apk add bash python3 lockfile-progs --no-cache && \ + python3 -m venv venv && \ + source venv/bin/activate && \ pip install --upgrade pip && \ pip install flask -WORKDIR /usr/src/app - COPY . ./ CMD ["bash", "start.sh"] diff --git a/start.sh b/start.sh index 2bc464f..35f05e6 100644 --- a/start.sh +++ b/start.sh @@ -1,4 +1,7 @@ #!/bin/bash + +source venv/bin/activate + python server.py & for ((i=1;i<=5;i++)); do