Skip to content

Commit f8d3136

Browse files
committed
#496 first stab upgrading Dockerfile to Ubuntu 24.04 - need venv
1 parent fe51fe0 commit f8d3136

File tree

9 files changed

+15
-11
lines changed

9 files changed

+15
-11
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:jammy
1+
FROM ubuntu:noble
22

33
# Credits to yjacolin for providing first versions
44
LABEL original_developer="yjacolin <yves.jacolin@camptocamp.com>" \
@@ -18,7 +18,7 @@ ENV LC_ALL="en_US.UTF-8" \
1818
LANGUAGE="en_US.UTF-8" \
1919
\
2020
\
21-
DEB_PACKAGES="locales gunicorn postgresql-client python3-gunicorn python3-gevent python3-psycopg2 python3-lxml python3-pyproj" \
21+
DEB_PACKAGES="locales gunicorn python3.12-venv postgresql-client python3-gunicorn python3-gevent python3-psycopg2 python3-lxml python3-pyproj" \
2222
DEB_BUILD_DEPS="make python3-pip" \
2323
# GHC ENV settings\
2424
ADMIN_NAME=admin \

GeoHealthCheck/migrations/versions/2638c2a40625_.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
"""
88
from alembic import op
99
import sqlalchemy as sa
10-
import imp
11-
import os
1210
from GeoHealthCheck.migrations import alembic_helpers
1311

1412
# revision identifiers, used by Alembic.

GeoHealthCheck/migrations/versions/496427d03f87_.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
"""
88
from alembic import op
99
import sqlalchemy as sa
10-
import imp
11-
import os
1210
from GeoHealthCheck.migrations import alembic_helpers
1311

1412
# revision identifiers, used by Alembic.

GeoHealthCheck/migrations/versions/992013af402f_.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
"""
88
from alembic import op
99
import sqlalchemy as sa
10-
import imp
11-
import os
1210
from GeoHealthCheck.migrations import alembic_helpers
1311

1412
# revision identifiers, used by Alembic.

docker/scripts/configure.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ echo "Using DB_TYPE=${DB_TYPE}"
1313
# Create DB shorthand
1414
function create_db() {
1515
pushd /GeoHealthCheck/ || exit 1
16+
source bin/activate
17+
1618
paver create -u ${ADMIN_NAME} -p ${ADMIN_PWD} -e ${ADMIN_EMAIL}
1719
popd || exit 1
1820
}

docker/scripts/install.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@
55
# e.g. fetching Metadata (Caps) and testing all layers
66
# Install Python packages for installation and setup
77

8+
python3 -m venv GeoHealthCheck
89
pushd /GeoHealthCheck || exit 1
910

11+
source bin/activate
12+
13+
1014
# Docker-specific deps
11-
pip install -r docker/scripts/requirements.txt
15+
pip install --no-cache-dir -r docker/scripts/requirements.txt
1216

1317
# Sets up GHC itself
1418
paver setup

docker/scripts/run-runner.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ echo "START /run-runner.sh"
1212
export PYTHONPATH=/GeoHealthCheck/GeoHealthCheck:$PYTHONPATH
1313

1414
cd /GeoHealthCheck
15+
source bin/activate
1516
paver runner_daemon
1617

1718
echo "END /run-runner.sh"

docker/scripts/run-tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ echo "START /run-tests.sh"
1717
export PYTHONPATH=/GeoHealthCheck/GeoHealthCheck:$PYTHONPATH
1818

1919
cd /GeoHealthCheck
20+
source bin/activate
2021
paver run_tests
2122

2223
echo "END /run-tests.sh"

docker/scripts/run-web.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,17 @@ echo "START /run-web.sh"
1313
# Make sure PYTHONPATH includes GeoHealthCheck
1414
export PYTHONPATH=/GeoHealthCheck/GeoHealthCheck:$PYTHONPATH
1515

16-
cd /GeoHealthCheck
16+
pushd /GeoHealthCheck || exit 1
17+
18+
source bin/activate
1719

1820
paver upgrade
1921

2022
# SCRIPT_NAME should not have value '/'
2123
[ "${SCRIPT_NAME}" = '/' ] && export SCRIPT_NAME="" && echo "make SCRIPT_NAME empty from /"
2224

2325
echo "Running GHC WSGI on ${HOST}:${PORT} with ${WSGI_WORKERS} workers and SCRIPT_NAME=${SCRIPT_NAME}"
24-
exec gunicorn --workers ${WSGI_WORKERS} \
26+
exec gunicorn --pythonpath /GeoHealthCheck/lib/python3.12/site-packages/ --workers ${WSGI_WORKERS} \
2527
--worker-class=${WSGI_WORKER_CLASS} \
2628
--timeout ${WSGI_WORKER_TIMEOUT} \
2729
--name="Gunicorn_GHC" \

0 commit comments

Comments
 (0)