-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove python 3.8 and unify docker images
- Loading branch information
1 parent
14373c4
commit ce6fdc8
Showing
14 changed files
with
92 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,7 +88,7 @@ More info about configuration options at https://developmentseed.org/tipg/user_g | |
## Launch | ||
|
||
```bash | ||
$ pip install uvicorn | ||
$ python -m pip install uvicorn | ||
|
||
# Set your PostGIS database instance URL in the environment | ||
$ export DATABASE_URL=postgresql://username:[email protected]:5432/postgis | ||
|
@@ -116,32 +116,29 @@ $ docker-compose up app | |
|
||
We are publishing two different docker images on `tag` and on every commit to `main` branch: | ||
|
||
| | Gunicorn | Uvicorn | | ||
| -- | -- | -- | | ||
main commit | `ghcr.io/developmentseed/tipg:latest` | `ghcr.io/developmentseed/tipg:uvicorn-latest` | ||
tags | `ghcr.io/developmentseed/tipg:0.0.0` | `ghcr.io/developmentseed/tipg:uvicorn-0.0.0` | ||
dockerfile | [/dockerfiles/Dockerfile.gunicorn](https://github.com/developmentseed/tipg/blob/main/dockerfiles/Dockerfile.gunicorn) | [/dockerfiles/Dockerfile.uvicorn](https://github.com/developmentseed/tipg/blob/main/dockerfiles/Dockerfile.uvicorn) | ||
| | Gunicorn | | ||
| -- | -- | | ||
main commit | `ghcr.io/developmentseed/tipg:latest` | ||
tags | `ghcr.io/developmentseed/tipg:X.X.X` | ||
dockerfile | [/dockerfiles/Dockerfile](https://github.com/developmentseed/tipg/blob/main/dockerfiles/Dockerfile) | ||
|
||
See all version at https://github.com/developmentseed/tipg/pkgs/container/tipg | ||
|
||
``` | ||
# Gunicorn image | ||
$ docker run \ | ||
-p 8081:8081 \ | ||
-e PORT=8081 \ | ||
-p 8000:8000 \ | ||
-e DATABASE_URL=postgresql://username:[email protected]:5432/postgis \ | ||
ghcr.io/developmentseed/tipg:latest | ||
ghcr.io/developmentseed/tipg:latest \ | ||
uvicorn tipg.main:app --host 0.0.0.0 --port 8000 --workers 1 | ||
# or Uvicorn image | ||
# using Gunicorn | ||
$ docker run \ | ||
-p 8081:8081 \ | ||
-e PORT=8081 \ | ||
-p 8000:8000 \ | ||
-e DATABASE_URL=postgresql://username:[email protected]:5432/postgis \ | ||
ghcr.io/developmentseed/tipg:uvicorn-latest | ||
ghcr.io/developmentseed/tipg:latest \ | ||
gunicorn -k uvicorn.workers.UvicornWorker tipg.main:app --bind 0.0.0.0:8000 --workers 1 | ||
``` | ||
|
||
Note: If you are planning to use the docker image in a kubernetes deployment you may want to use the `uvicorn` image (ref: https://fastapi.tiangolo.com/deployment/server-workers/). | ||
|
||
## Contribution & Development | ||
|
||
See [CONTRIBUTING.md](https://github.com/developmentseed/tipg/blob/main/CONTRIBUTING.md) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
ARG PYTHON_VERSION=3.12 | ||
|
||
FROM bitnami/python:${PYTHON_VERSION} | ||
RUN apt update && apt upgrade -y \ | ||
&& apt install curl -y \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Ensure root certificates are always updated at evey container build | ||
# and curl is using the latest version of them | ||
RUN mkdir /usr/local/share/ca-certificates/cacert.org | ||
RUN cd /usr/local/share/ca-certificates/cacert.org && curl -k -O https://www.cacert.org/certs/root.crt | ||
RUN cd /usr/local/share/ca-certificates/cacert.org && curl -k -O https://www.cacert.org/certs/class3.crt | ||
RUN update-ca-certificates | ||
ENV CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt | ||
|
||
RUN python -m pip install -U pip | ||
RUN python -m pip install uvicorn uvicorn-worker gunicorn | ||
|
||
COPY README.md README.md | ||
COPY LICENSE LICENSE | ||
COPY tipg/ tipg/ | ||
COPY pyproject.toml pyproject.toml | ||
|
||
RUN python -m pip install . --no-cache-dir | ||
RUN rm -rf tipg/ README.md pyproject.toml LICENSE | ||
|
||
################################################### | ||
# For compatibility (might be removed at one point) | ||
ENV MODULE_NAME=tipg.main | ||
ENV VARIABLE_NAME=app | ||
ENV HOST=0.0.0.0 | ||
ENV PORT=80 | ||
ENV WEB_CONCURRENCY=1 | ||
CMD gunicorn -k uvicorn.workers.UvicornWorker ${MODULE_NAME}:${VARIABLE_NAME} --bind ${HOST}:${PORT} --workers ${WEB_CONCURRENCY} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
name = "tipg" | ||
description = "Simple and Fast Geospatial OGC Features and Tiles API for PostGIS." | ||
readme = "README.md" | ||
requires-python = ">=3.8" | ||
requires-python = ">=3.9" | ||
license = {file = "LICENSE"} | ||
authors = [ | ||
{name = "Vincent Sarago", email = "[email protected]"}, | ||
|
@@ -13,10 +13,11 @@ classifiers = [ | |
"Intended Audience :: Information Technology", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: BSD License", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: 3.13", | ||
"Topic :: Scientific/Engineering :: GIS", | ||
] | ||
dynamic = ["version"] | ||
|
@@ -33,8 +34,6 @@ dependencies = [ | |
"pygeofilter>=0.2.0,<0.3.0", | ||
"ciso8601~=2.3", | ||
"starlette-cramjam>=0.4,<0.5", | ||
"importlib_resources>=1.1.0; python_version < '3.9'", | ||
"typing_extensions; python_version < '3.9'", | ||
] | ||
|
||
[project.optional-dependencies] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.