Skip to content

Commit

Permalink
maintenance
Browse files Browse the repository at this point in the history
removed docker folder in favor of single dockerfile
added docker compose
added info to readme about docker
readme changed to md
added up to date badges
modified ci to match
removed vagrant
removed jenkins
removed requirements in favor of setup.py
added pyproject toml for build systems
  • Loading branch information
jankovicgd committed Dec 23, 2022
1 parent 3bf1adf commit 935f1ef
Show file tree
Hide file tree
Showing 36 changed files with 122 additions and 1,233 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ autotest
build
dist
documentation
schemas
schemas
debian/
14 changes: 4 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,18 @@ jobs:
# django: "1.11.26"
# python_bin: python3
# pip_bin: pip3
- os: ubuntu
python: py3
db: postgis
django: "3.2.12"
- db: postgis
python_bin: python3
pip_bin: pip3
- os: ubuntu
python: py3
db: spatialite
django: "3.2.12"
- db: spatialite
python_bin: python3
pip_bin: pip3
latest: true
steps:
- uses: actions/checkout@v2
- name: Build the eoxserver docker image
run: |
docker build -t eoxserver --build-arg DJANGO=${{ matrix.django }} -f docker/${{ matrix.os }}/${{ matrix.python }}/Dockerfile .
docker build -t eoxserver .
- name: Run the tests
env:
COMPOSE_INTERACTIVE_NO_CLI: 1
Expand Down Expand Up @@ -95,7 +89,7 @@ jobs:
if: success() && steps.branch_name.outputs.SOURCE_TAG && matrix.latest
- name: Tag docker release image with OS and Python/Django versions
run: |
docker tag eoxserver eoxa/eoxserver:${{ steps.branch_name.outputs.SOURCE_TAG }}-${{ matrix.os }}-${{ matrix.python }}-django${{ matrix.django }}
docker tag eoxserver eoxa/eoxserver:${{ steps.branch_name.outputs.SOURCE_TAG }}
if: success() && startsWith(steps.branch_name.outputs.SOURCE_TAG, 'release-')
- name: Push docker images
run: |
Expand Down
30 changes: 8 additions & 22 deletions docker/ubuntu/py3/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
FROM ubuntu:22.04

ARG DJANGO=3.2.12
ARG TZ=UTC

ENV INSTANCE_NAME=instance
ENV TZ=UTC

# possible values are "postgis" and "spatialite"
ENV DB=spatialite
Expand All @@ -24,7 +22,9 @@ ENV INIT_SCRIPTS=''
ENV GUNICORN_CMD_ARGS "--config /opt/eoxserver/gunicorn.conf.py ${INSTANCE_NAME}.wsgi:application"

# install OS dependency packages
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN mkdir /opt/eoxserver/
WORKDIR /opt/eoxserver
COPY . .
RUN apt-get update \
&& apt-get install -y \
python3 \
Expand All @@ -38,26 +38,12 @@ RUN apt-get update \
python3-psycopg2 \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/partial/* /tmp/* /var/tmp/*

# install EOxServer
RUN mkdir /opt/eoxserver/

ADD eoxserver /opt/eoxserver/eoxserver
ADD tools /opt/eoxserver/tools
ADD setup.cfg setup.py MANIFEST.in README.rst requirements.txt /opt/eoxserver/
ADD docker/eoxserver-entrypoint.sh /opt/eoxserver/
ADD docker/gunicorn.conf.py /opt/eoxserver/

# install EOxServer and its dependencies
WORKDIR /opt/eoxserver

RUN pip3 install -r requirements.txt \
&& pip3 install "django==$DJANGO" \
&& pip3 install .
&& rm -rf /var/lib/apt/lists/partial/* /tmp/* /var/tmp/* \
&& pip3 install --no-cache-dir . \
&& chmod +x entrypoint.sh

EXPOSE 8000

ENTRYPOINT ["/opt/eoxserver/eoxserver-entrypoint.sh"]
ENTRYPOINT ["./entrypoint.sh"]

CMD "gunicorn" $GUNICORN_CMD_ARGS
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include README.rst
include README.md
include MANIFEST.in
graft eoxserver
recursive-exclude eoxserver *.pyc
67 changes: 67 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# EOxServer

EOxServer is a Python application and library for presenting Earth
Observation (EO) data and metadata.

![build](https://github.com/EOxServer/eoxserver/actions/workflows/ci.yml/badge.svg)
[![PyPi](https://badge.fury.io/py/EOxServer.svg)](https://pypi.org/project/EOxServer/)
[![ReadTheDocs](https://readthedocs.org/projects/eoxserver/badge/?version=master)](http://docs.eoxserver.org/en/master)

EOxServer implements the [OGC](http://www.opengeospatial.org)
Implementation Specifications EO-WCS and EO-WMS on top of
[MapServer's](http://mapserver.org) [WCS](http://www.opengeospatial.org/standards/wcs) and
[WMS](http://www.opengeospatial.org/standards/wms) implementations.
EOxServer is released under the
[EOxServer Open License](https://docs.eoxserver.org/en/stable/copyright.html) an MIT-style
license and written in python and entirely based on open source software including:

- [MapServer](http://mapserver.org)
- [Django/GeoDjango](https://www.djangoproject.com)
- [GDAL](http://www.gdal.org>)
- [SpatiaLite](http://www.gaia-gis.it/spatialite)
- [PostGIS](http://postgis.refractions.net/>)
- [PROJ.4](http://trac.osgeo.org/proj/>)

More information is available at [https://eoxserver.org](https://eoxserver.org). Documentation
is available at [readthedocs](https://docs.eoxserver.org/en/stable/)

## Docker

To run with SpatiaLite database simply run:

```sh
docker run -it --rm -p 8080:8000 eoxa/eoxserver
```

EOxServer is now accessible at [http://localhost:8080/](http://localhost:8080/).
And you can login to the `Admin Client` using:

- username: admin
- password: admin

The following environment variables control configuration:

- `DB`: Specify the used database type. either `spatialite` or `postgis`
- `DB_PW`, `DB_NAME`, `DB_HOST`, `DB_USER`: these credentials will be used to establish a
connection to the postgres database when DB is set to `postgis` in order to wait
for it to come online
- `INSTANCE_NAME`: the name of the instance passed to `eoxserver-instance.py` - defaults
to `instance`
- `INSTANCE_DIR`: the directory of the instance. Defaults to `/opt/instance`
- `DJANGO_USER`, `DJANGO_MAIL`, `DJANGO_PASSWORD`: when set, these credentials will be
used to create a superuser to be used for the Django Admin. By default, no user is
created
- `COLLECT_STATIC`: if set to "true" (the default), static files will be collected
upon initialization
- `PREINIT_SCRIPTS`: the list of commands that will be executed before
the instance is initialized
- `INIT_SCRIPTS`: the list of commands that will be executed once
when the instance is initialized
- `STARTUP_SCRIPTS`: the list of commands that will be executed before
the command is run
- `GUNICORN_CMD_ARGS`: gunicorn command arguments. Defaults to
`--config /opt/eoxserver/gunicorn.conf.py ${INSTANCE_NAME}.wsgi:application`

## Development

The autotest instance can be used for development.
34 changes: 0 additions & 34 deletions README.rst

This file was deleted.

2 changes: 1 addition & 1 deletion autotest/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include README.rst
include README.md
include MANIFEST.in
include HOWTO
graft autotest
Expand Down
4 changes: 4 additions & 0 deletions autotest/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# autotest

Autotest is an instance of EOxServer used for unit and integration tests. Can be used
for debugging.
25 changes: 0 additions & 25 deletions autotest/README.rst

This file was deleted.

5 changes: 0 additions & 5 deletions autotest/autotest/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,6 @@
# search will be done.
COMPONENTS = ()


#
#
#
#
EOXS_PROCESSES = DEFAULT_EOXS_PROCESSES + [
'autotest_services.processes.test00_identity_literal.TestProcess00',
'autotest_services.processes.test01_identity_bbox.TestProcess01',
Expand Down
24 changes: 24 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: "3.6"
services:
database:
image: mdillon/postgis:10
volumes:
- database-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: "user"
POSTGRES_PASSWORD: "pw"
POSTGRES_DB: "database"
ports:
- 5432:5432
restart: 'no'

eoxserver:
build: .
env_file:
- ./sample.env
ports:
- 8080:8000
- 5678:5678

volumes:
database-data:
53 changes: 0 additions & 53 deletions docker/Readme.md

This file was deleted.

47 changes: 0 additions & 47 deletions docker/centos/py2/Dockerfile

This file was deleted.

Loading

0 comments on commit 935f1ef

Please sign in to comment.