Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set qpa and pythonpath #2

Merged
merged 4 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches:
- main

pull_request:
branches:
- main

schedule:
- cron: '30 5 * * *'

Expand Down Expand Up @@ -55,9 +59,30 @@ jobs:
QGIS_VERSION_SHORT=${{ env.QGIS_VERSION_SHORT }}
cache-to: type=local,dest=cache

- name: Build and push release
uses: docker/build-push-action@v3
- name: Build release
uses: docker/build-push-action@v6
if: env.DO_BUILD == 'true'
with:
context: .
push: false
load: true
build-args: |
QGIS_VERSION=${{ env.QGIS_VERSION_TAG }}
QGIS_VERSION_SHORT=${{ env.QGIS_VERSION_SHORT }}
cache-from: type=local,src=cache
tags: |
ghcr.io/opengisch/qgis-slim:latest
ghcr.io/opengisch/qgis-slim:${{ matrix.release_line }}
ghcr.io/opengisch/qgis-slim:${{ env.QGIS_VERSION_SHORT }}
ghcr.io/opengisch/qgis-slim:${{ env.QGIS_VERSION_PATCH }}

- name: Test
run: |
docker run --rm ghcr.io/opengisch/qgis-slim:latest python3 -c 'from qgis.core import QgsApplication; QgsApplication([], False)'

- name: Push release
uses: docker/build-push-action@v6
if: env.DO_BUILD == 'true' && github.event_name != 'pull_request'
with:
context: .
push: true
Expand All @@ -71,6 +96,7 @@ jobs:
ghcr.io/opengisch/qgis-slim:${{ env.QGIS_VERSION_SHORT }}
ghcr.io/opengisch/qgis-slim:${{ env.QGIS_VERSION_PATCH }}


# - name: Build and push debug
# uses: docker/build-push-action@v3
# if: env.DO_BUILD == 'true'
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
# -----------------------------------------------------------------------------

FROM ${OS_VERSION}
ENV QGIS_AUTH_DB_DIR_PATH=/auth

Check warning on line 138 in Dockerfile

View workflow job for this annotation

GitHub Actions / docker (ltr)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "QGIS_AUTH_DB_DIR_PATH") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 138 in Dockerfile

View workflow job for this annotation

GitHub Actions / docker (stable)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "QGIS_AUTH_DB_DIR_PATH") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

RUN apt-get update && \
apt-get upgrade -y && \
Expand Down Expand Up @@ -237,6 +237,9 @@

ENTRYPOINT [ "/tini", "--", "/usr/local/bin/uid_entrypoint.sh" ]

ENV PYTHONPATH="/usr/share/qgis/python/"
ENV QT_QPA_PLATFORM=offscreen

EXPOSE 5000

CMD [ "/usr/local/bin/run.sh" ]
Expand Down
Loading