diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f160c1d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +requirements.in +.github +.gitignore +README.md +.env \ No newline at end of file diff --git a/.github/workflows/Branch-protection.yml b/.github/workflows/Branch-protection.yml new file mode 100644 index 0000000..c18d3a6 --- /dev/null +++ b/.github/workflows/Branch-protection.yml @@ -0,0 +1,11 @@ +name: Check branch origin + +on: + pull_request: + +jobs: + check-branch-protection: + uses: Geode-solutions/actions/.github/workflows/branch-protection.yml@master + with: + branch_from: 'next' + branch_to: 'master' diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml new file mode 100644 index 0000000..6ff2b2f --- /dev/null +++ b/.github/workflows/docker-images.yml @@ -0,0 +1,12 @@ +name: Docker Image CD +on: + push: + branches: [ master, next ] +jobs: + docker-build-squash-push: + uses: Geode-solutions/actions/.github/workflows/docker-build-squash-push.yml@master + with: + image_name: 'website-viewer' + tag: ${{ github.ref_name }} + secrets: + TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..58ae2d9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM python:3.9-slim + +WORKDIR /app + +COPY . . +RUN pip3 install --user -r requirements.txt && pip3 cache purge +RUN pip3 install https://www.vtk.org/files/release/9.3/vtk_osmesa-9.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl +ENV PYTHONPATH="/usr/local:$PYTHONPATH" +ENV PYTHON_ENV="prod" + +CMD python app.py + +EXPOSE 1234 \ No newline at end of file diff --git a/app.py b/app.py new file mode 100644 index 0000000..af40d59 --- /dev/null +++ b/app.py @@ -0,0 +1,11 @@ +from opengeodeweb_viewer import vtkw_server +import os +import dotenv + +basedir = os.path.abspath(os.path.dirname(__file__)) +dot_env_path = os.path.join(basedir, "./.env") +if os.path.isfile(dot_env_path): + dotenv.load_dotenv(dot_env_path) + +if __name__ == "__main__": + vtkw_server.run_server() diff --git a/requirements.in b/requirements.in new file mode 100644 index 0000000..e24c973 --- /dev/null +++ b/requirements.in @@ -0,0 +1 @@ +OpenGeodeWeb-Viewer \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a0ea5f9 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,66 @@ +# +# This file is autogenerated by pip-compile with Python 3.9 +# by the following command: +# +# pip-compile requirements.in +# +aiohttp==3.9.3 + # via + # opengeodeweb-viewer + # wslink +aiosignal==1.3.1 + # via + # aiohttp + # opengeodeweb-viewer +async-timeout==4.0.3 + # via + # aiohttp + # opengeodeweb-viewer +attrs==23.2.0 + # via + # aiohttp + # jsonschema + # opengeodeweb-viewer + # referencing +frozenlist==1.4.1 + # via + # aiohttp + # aiosignal + # opengeodeweb-viewer +idna==3.6 + # via + # opengeodeweb-viewer + # yarl +jsonschema==4.21.1 + # via opengeodeweb-viewer +jsonschema-specifications==2023.12.1 + # via + # jsonschema + # opengeodeweb-viewer +multidict==6.0.5 + # via + # aiohttp + # opengeodeweb-viewer + # yarl +opengeodeweb-viewer==0.1.1 + # via -r requirements.in +python-dotenv==1.0.1 + # via opengeodeweb-viewer +referencing==0.33.0 + # via + # jsonschema + # jsonschema-specifications + # opengeodeweb-viewer +rpds-py==0.18.0 + # via + # jsonschema + # opengeodeweb-viewer + # referencing +websocket-client==1.7.0 + # via opengeodeweb-viewer +wslink==1.12.4 + # via opengeodeweb-viewer +yarl==1.9.4 + # via + # aiohttp + # opengeodeweb-viewer