diff --git a/.github/workflows/check_charts.yaml b/.github/workflows/check_charts.yaml index b3558a0c5..deed88fe4 100644 --- a/.github/workflows/check_charts.yaml +++ b/.github/workflows/check_charts.yaml @@ -62,7 +62,7 @@ jobs: # See https://github.com/developmentseed/titiler/discussions/387 platforms: linux/amd64 context: . - file: dockerfiles/Dockerfile.gunicorn + file: dockerfiles/Dockerfile.uvicorn push: false tags: "titiler:dev" @@ -75,4 +75,4 @@ jobs: if: steps.list-changed.outputs.changed == 'true' - name: Run chart-testing (install) - run: ct install --chart-dirs deployment/k8s \ No newline at end of file + run: ct install --chart-dirs deployment/k8s diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5355506d6..262e51fc4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,7 +132,34 @@ jobs: id: tag # https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} + # Uvicorn + # Push `latest` when commiting to master + - name: Build and push uvicorn + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + # See https://github.com/developmentseed/titiler/discussions/387 + platforms: linux/amd64 + context: . + file: dockerfiles/Dockerfile.uvicorn + push: true + tags: | + ghcr.io/${{ github.repository }}-uvicorn:latest + + # Push `{VERSION}` when pushing a new tag + - name: Build and push uvicorn + if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' + uses: docker/build-push-action@v2 + with: + # See https://github.com/developmentseed/titiler/discussions/387 + platforms: linux/amd64 + context: . + file: dockerfiles/Dockerfile.uvicorn + push: true + tags: | + ghcr.io/${{ github.repository }}-uvicorn:${{ steps.tag.outputs.tag }} + # Gunicorn # Push `latest` when commiting to master - name: Build and push if: github.ref == 'refs/heads/master' diff --git a/deployment/k8s/charts/Chart.yaml b/deployment/k8s/charts/Chart.yaml index 5fea3f91a..dcc94b5cf 100644 --- a/deployment/k8s/charts/Chart.yaml +++ b/deployment/k8s/charts/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: 0.7.1 description: A dynamic Web Map tile server name: titiler -version: 1.0.0 +version: 1.1.0 icon: https://raw.githubusercontent.com/developmentseed/titiler/master/docs/logos/TiTiler_logo_small.png maintainers: - name: emmanuelmathot # Emmanuel Mathot diff --git a/deployment/k8s/charts/values.yaml b/deployment/k8s/charts/values.yaml index f314ec7ac..b10995183 100644 --- a/deployment/k8s/charts/values.yaml +++ b/deployment/k8s/charts/values.yaml @@ -2,7 +2,7 @@ replicaCount: 1 image: - repository: ghcr.io/developmentseed/titiler + repository: ghcr.io/developmentseed/titiler-uvicorn tag: latest pullPolicy: IfNotPresent diff --git a/dockerfiles/Dockerfile.gunicorn b/dockerfiles/Dockerfile.gunicorn index 39ad6ffc9..bbc07261b 100644 --- a/dockerfiles/Dockerfile.gunicorn +++ b/dockerfiles/Dockerfile.gunicorn @@ -17,4 +17,4 @@ RUN pip install /tmp/titiler/core /tmp/titiler/mosaic /tmp/titiler/application - RUN rm -rf /tmp/titiler ENV MODULE_NAME titiler.application.main -ENV VARIABLE_NAME app +ENV VARIABLE_NAME app \ No newline at end of file diff --git a/dockerfiles/Dockerfile.uvicorn b/dockerfiles/Dockerfile.uvicorn index 19277b774..7c787c213 100644 --- a/dockerfiles/Dockerfile.uvicorn +++ b/dockerfiles/Dockerfile.uvicorn @@ -1,10 +1,10 @@ # Dockerfile for running titiler application with uvicorn server -# Size ~600MB ARG PYTHON_VERSION=3.9 -FROM python:${PYTHON_VERSION}-slim - -RUN apt-get update && apt-get install curl -y +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 @@ -20,4 +20,4 @@ RUN rm -rf /tmp/titiler ENV HOST 0.0.0.0 ENV PORT 80 -CMD uvicorn titiler.application.main:app --host ${HOST} --port ${PORT} +CMD uvicorn titiler.application.main:app --host ${HOST} --port ${PORT} \ No newline at end of file