Skip to content
Snippets Groups Projects
Commit f9ff0a36 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Merge branch 'nkupdates-edge' into 'edge'

Nkupdates edge

See merge request !39
parents 82a74e98 aa0adeb1
Branches
No related tags found
2 merge requests!44Updated to Alpine 3.20,!39Nkupdates edge
......@@ -129,14 +129,6 @@ Keeping in mind that the `workers`, `module` and `callable` can be customized us
Environment variables to export for UWSGI.
## /app/requirements.txt
If `/app/requirements.txt` exists and no `/app/.venv` exists, a virtual environment will be created using the
`requirements.txt` file.
The virtual environment can be persisted using a volume for `/app/.venv`.
## /app/static/
This directory will be served directly from Nginx bypassing UWSGI.
......@@ -144,9 +136,17 @@ This directory will be served directly from Nginx bypassing UWSGI.
## /app/.venv/
If this directory exists it will be used as the virtualenv for the application. It will be automatically created if
`/app/requirements.txt` exists.
Virtual environment for the application which must be created beforehand.
This can be created with...
```sh
docker run -it --rm \
-v /path/to/venv:/app/.venv \
-v /path/to/app/requirements.txt:/app/requirements.txt \
allworldit/nginx-uwsgi \
/bin/sh -c "python -m venv /app/.venv; . /app/.venv/bin/activate; pip install --requirement /app/requirements.txt"
```
# Health Checks
......
......@@ -36,14 +36,3 @@ fi
if [ -n "$UWSGI_CALLABLE" ]; then
sed -i -e "s/callable = app/callable = $UWSGI_CALLABLE/" /etc/uwsgi/app.ini
fi
# If we have a requirements.txt file it can be assumed we need to setup a virtualenv
if [ -e /app/requirements.txt ]; then
# If we have a bin directory, it's probably already set up
if [ ! -d /app/.venv/bin ]; then
fdc_notice "Installing Nginx UWSGI app depedencies"
python -m venv /app/.venv
/app/.venv/bin/pip install --no-cache --upgrade pip
/app/.venv/bin/pip install --no-cache --requirement /app/requirements.txt
fi
fi
\ No newline at end of file
......@@ -33,5 +33,12 @@ cat <<EOF > /app/requirements.txt
flask
EOF
python -m venv /app/.venv
(
# shellcheck disable=SC1091
. /app/.venv/bin/activate
pip install -r /app/requirements.txt
)
mkdir /app/static
echo '/* TEST STATIC SUCCESS */' > /app/static/file.css
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment