Skip to content

Commit

Permalink
Merge pull request #10 from balena-io/cmfcruz/use-python-venv
Browse files Browse the repository at this point in the history
Use python3 venv which is recommended for adhering with PEP 668.
  • Loading branch information
flowzone-app[bot] authored Nov 1, 2024
2 parents b70d736 + 045c611 commit 38f8542
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/flowzone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ jobs:
(github.event.pull_request.head.repo.full_name != github.repository && github.event_name == 'pull_request_target')
uses: product-os/flowzone/.github/workflows/flowzone.yml@master
secrets: inherit
with: {}
8 changes: 5 additions & 3 deletions Dockerfile.template
Original file line number Diff line number Diff line change
@@ -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"]
3 changes: 3 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash

source venv/bin/activate

python server.py &
for ((i=1;i<=5;i++));
do
Expand Down

0 comments on commit 38f8542

Please sign in to comment.