Skip to content

Commit 6b58c52

Browse files
committed
add docker publication job in CI workflow and remove uvicorn-only dockerfile and references to it
1 parent 8c8236f commit 6b58c52

File tree

5 files changed

+56
-70
lines changed

5 files changed

+56
-70
lines changed

.github/workflows/ci.yml

+53
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,56 @@ jobs:
5858
flags: unittests
5959
name: ${{ matrix.python-version }}
6060
fail_ci_if_error: false
61+
62+
63+
publish-docker:
64+
needs: [tests]
65+
# runs on push to main, on tag creation, and on release
66+
if: github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
67+
runs-on: ubuntu-latest
68+
69+
steps:
70+
- name: Checkout
71+
uses: actions/checkout@v4
72+
73+
- name: Set up QEMU
74+
uses: docker/setup-qemu-action@v3
75+
76+
- name: Set up Docker Buildx
77+
uses: docker/setup-buildx-action@v3
78+
79+
- name: Login to Github
80+
uses: docker/login-action@v3
81+
with:
82+
registry: ghcr.io
83+
username: ${{ github.actor }}
84+
password: ${{ secrets.GITHUB_TOKEN }}
85+
86+
- name: Set tag version
87+
id: tag
88+
run: |
89+
echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
90+
91+
# Push `latest` when comiting to main
92+
- name: Build and push latest
93+
if: github.ref == 'refs/heads/main'
94+
uses: docker/build-push-action@v5
95+
with:
96+
platforms: linux/amd64
97+
context: .
98+
file: Dockerfile
99+
push: true
100+
tags: |
101+
ghcr.io/stac-utils/titiler-stacapi:latest
102+
103+
# Push `{VERSION}` when pushing a new tag
104+
- name: Build and push tag
105+
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
106+
uses: docker/build-push-action@v5
107+
with:
108+
platforms: linux/amd64
109+
context: .
110+
file: Dockerfile
111+
push: true
112+
tags: |
113+
ghcr.io/stac-utils/titiler-stacapi:${{ steps.tag.outputs.version }}

README.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,7 @@ $ cd titiler-stacapi
5757
$ docker-compose up --build api
5858
```
5959

60-
It runs `titiler.stacapi` using Gunicorn web server. To run Uvicorn based version:
61-
62-
```
63-
$ docker-compose up --build api-uvicorn
64-
```
60+
It runs `titiler.stacapi` using Gunicorn web server.
6561

6662
## Contribution & Development
6763

docker-compose.yml

+2-47
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77
platform: linux/amd64
88
build:
99
context: .
10-
dockerfile: dockerfiles/Dockerfile.gunicorn
10+
dockerfile: dockerfiles/Dockerfile
1111
ports:
1212
- "8081:8081"
1313
environment:
@@ -43,49 +43,4 @@ services:
4343
# - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
4444
# TiTiler STAC API Config
4545
- TITILER_STACAPI_API_DEBUG=TRUE
46-
- TITILER_STACAPI_STAC_API_URL=
47-
48-
api-uvicorn:
49-
# At the time of writing, rasterio wheels are not available for arm64 arch
50-
# so we force the image to be built with linux/amd64
51-
platform: linux/amd64
52-
build:
53-
context: .
54-
dockerfile: dockerfiles/Dockerfile.uvicorn
55-
ports:
56-
- "8081:8081"
57-
environment:
58-
# Application
59-
- HOST=0.0.0.0
60-
- PORT=8081
61-
- WEB_CONCURRENCY=1
62-
# GDAL Config
63-
- CPL_TMPDIR=/tmp
64-
# This option controls the default GDAL raster block cache size.
65-
# If its value is small (less than 100000), it is assumed to be measured in megabytes, otherwise in bytes.
66-
- GDAL_CACHEMAX=200
67-
- GDAL_DISABLE_READDIR_ON_OPEN=EMPTY_DIR
68-
- GDAL_INGESTED_BYTES_AT_OPEN=32768
69-
- GDAL_HTTP_MERGE_CONSECUTIVE_RANGES=YES
70-
- GDAL_HTTP_MULTIPLEX=YES
71-
- GDAL_HTTP_VERSION=2
72-
# The file can be cached in RAM by setting the configuration option VSI_CACHE to TRUE.
73-
# The cache size defaults to 25 MB, but can be modified by setting the configuration option VSI_CACHE_SIZE (in bytes).
74-
# Content in that cache is discarded when the file handle is closed.
75-
- VSI_CACHE=TRUE
76-
- VSI_CACHE_SIZE=536870912
77-
# In addition, a global least-recently-used cache of 16 MB shared among all downloaded content is enabled by default,
78-
# and content in it may be reused after a file handle has been closed and reopen,
79-
# during the life-time of the process or until VSICurlClearCache() is called.
80-
# Starting with GDAL 2.3, the size of this global LRU cache can be modified by
81-
# setting the configuration option CPL_VSIL_CURL_CACHE_SIZE (in bytes).
82-
- CPL_VSIL_CURL_CACHE_SIZE=200000000
83-
# TiTiler Config
84-
- MOSAIC_CONCURRENCY=5
85-
# - RIO_TILER_MAX_THREADS=2
86-
# AWS S3 endpoint config
87-
# - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
88-
# - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
89-
# TiTiler STAC API Config
90-
- TITILER_STACAPI_API_DEBUG=TRUE
91-
- TITILER_STACAPI_STAC_API_URL=
46+
- TITILER_STACAPI_STAC_API_URL=
File renamed without changes.

dockerfiles/Dockerfile.uvicorn

-18
This file was deleted.

0 commit comments

Comments
 (0)