Skip to content

Commit

Permalink
removed installation from docker
Browse files Browse the repository at this point in the history
added gdal as setup.py programatically inferred dependency
small fixes
  • Loading branch information
jankovicgd committed May 3, 2023
1 parent 540d725 commit 845b623
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ FROM ubuntu:22.04

ENV INSTANCE_NAME=instance
ENV TZ=UTC
ENV PYTHONPATH='/opt/eoxserver'
ENV PYTHONUNBUFFERED="1"

# possible values are "postgis" and "spatialite"
ENV DB=spatialite
Expand Down Expand Up @@ -50,8 +52,6 @@ RUN python3 -m pip install -U pip \

# install EOxServer
COPY . .
RUN python3 -m pip install --no-cache-dir . \
&& chmod +x entrypoint.sh

EXPOSE 8000

Expand Down
4 changes: 2 additions & 2 deletions entrypoint.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ if [ ! -d "${INSTANCE_DIR}" ]; then
source $f
done
fi

eoxserver-instance.py "${INSTANCE_NAME}" "${INSTANCE_DIR}"
./eoxserver/scripts/eoxserver-instance.py "${INSTANCE_NAME}" "${INSTANCE_DIR}"
cd "${INSTANCE_DIR}"

# create the database schema
Expand Down
2 changes: 1 addition & 1 deletion eoxserver/instance_template/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
"forget to activate a virtual environment?"
)
raise
execute_from_command_line(sys.argv)
execute_from_command_line(sys.argv)
3 changes: 1 addition & 2 deletions eoxserver/scripts/eoxserver-instance.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
#-------------------------------------------------------------------------------
#
# Project: EOxServer <http://eoxserver.org>
Expand Down Expand Up @@ -42,7 +42,6 @@
import eoxserver
from eoxserver.core.instance import create_instance


def main():
parser = OptionParser(
usage=textwrap.dedent("""\
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ python-swiftclient<5.0.0
jsonfield
gunicorn
mapscript
gdal
2 changes: 0 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ scripts =
tools/eoxserver-validate_xml.py
tools/eoxserver-preprocess.py

install_requires = file: requirements.txt

[options.extras_require]
dev =
scipy
Expand Down
21 changes: 21 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from setuptools import setup
import subprocess
import pkg_resources


with open('requirements.txt', 'r') as reqs:
install_requires = [
str(requirement)
for requirement
in pkg_resources.parse_requirements(reqs)
]

try:
gdal_version = subprocess.check_output(['gdal-config','--version']).decode('utf-8').strip()
except FileNotFoundError:
gdal_version = subprocess.check_output(['gdalinfo','--version']).decode('utf-8').split(' ')[1].strip(',')

install_requires.append(f'gdal=={gdal_version}')

if __name__ == "__main__":
setup(install_requires=install_requires)

0 comments on commit 845b623

Please sign in to comment.