Skip to content

Commit b49aca1

Browse files
authored
Merge pull request #359 from sandstorm-io/add-python-stack
Add basic Python stack
2 parents 145e545 + 4c1f46d commit b49aca1

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

stacks/python/build.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
VENV=/opt/app-venv
4+
if [ ! -d $VENV ] ; then
5+
sudo mkdir -p $VENV -m777
6+
virtualenv $VENV
7+
else
8+
echo "$VENV exists, moving on"
9+
fi
10+
11+
cd /opt/app
12+
if [ -f /opt/app/requirements.txt ] ; then
13+
$VENV/bin/pip install -r /opt/app/requirements.txt
14+
fi
15+
16+
exit 0

stacks/python/launcher.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
VENV=/opt/app-venv
4+
cd /opt/app
5+
6+
# Change app.py to your app's filename
7+
$VENV/bin/python3 app.py
8+
9+
exit 0

stacks/python/setup.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
# When you change this file, you must take manual action. Read this doc:
4+
# - https://docs.sandstorm.io/en/latest/vagrant-spk/customizing/#setupsh
5+
6+
set -euo pipefail
7+
export DEBIAN_FRONTEND=noninteractive
8+
apt-get update
9+
apt-get install -y build-essential python3-dev python3-pip python3-venv pipenv sqlite3 git
10+
11+
exit 0

0 commit comments

Comments
 (0)