From e68f4da7e5e3cb0231fcd0ee90cb4f80482eecc8 Mon Sep 17 00:00:00 2001 From: Tristan Damron Date: Wed, 31 Jul 2024 20:56:07 -0700 Subject: [PATCH] Slight refactor, update base image versions --- Dockerfiles/Dockerfile.geocml-postgres | 6 +++--- Dockerfiles/Dockerfile.geocml-server | 4 ++-- Dockerfiles/Dockerfile.geocml-task-scheduler | 7 ++++--- ansible-playbooks/geocml-postgres-playbook.yaml | 3 +-- ansible-playbooks/geocml-postgres-requirements.yaml | 7 +++---- ansible-playbooks/geocml-server-playbook.yaml | 5 ++--- ansible-playbooks/geocml-server-requirements.yaml | 7 +++---- docker-compose.yml | 3 ++- 8 files changed, 20 insertions(+), 22 deletions(-) diff --git a/Dockerfiles/Dockerfile.geocml-postgres b/Dockerfiles/Dockerfile.geocml-postgres index 3b6e6ee..17e541e 100644 --- a/Dockerfiles/Dockerfile.geocml-postgres +++ b/Dockerfiles/Dockerfile.geocml-postgres @@ -1,4 +1,4 @@ -FROM ubuntu:latest +FROM ubuntu:22.04 USER root RUN apt update @@ -11,14 +11,14 @@ RUN apt install -y python3-pip && pip install psycopg2-binary # Install PostgreSQL, PostGIS ARG DEBIAN_FRONTEND=noninteractive -RUN apt install -y postgresql postgis +RUN apt install -y postgresql postgis # Install Ansible RUN apt install -y ansible # Install Ansible dependencies and run through playbook COPY ./ansible-playbooks/geocml-postgres-requirements.yaml ./ansible-playbooks/geocml-postgres-playbook.yaml ./ -RUN ansible-galaxy install -r geocml-postgres-requirements.yaml && ansible-playbook -i,localhost geocml-postgres-playbook.yaml --tags "all" && rm -f ./*.yaml +RUN ansible-galaxy collection install ansible.posix && ansible-galaxy install -r geocml-postgres-requirements.yaml --force && ansible-playbook -i,localhost geocml-postgres-playbook.yaml --tags "all" && rm -f ./*.yaml ######### Customize Container Here ########### ######### End Customizations ########### diff --git a/Dockerfiles/Dockerfile.geocml-server b/Dockerfiles/Dockerfile.geocml-server index 4c1043c..2acdc12 100644 --- a/Dockerfiles/Dockerfile.geocml-server +++ b/Dockerfiles/Dockerfile.geocml-server @@ -1,4 +1,4 @@ -FROM ubuntu:latest +FROM ubuntu:22.04 RUN apt update @@ -19,7 +19,7 @@ RUN apt install -y ansible # Install Ansible dependencies and run through playbook COPY ./ansible-playbooks/geocml-server-requirements.yaml ./ansible-playbooks/geocml-server-playbook.yaml ./ -RUN ansible-galaxy install -r geocml-server-requirements.yaml && ansible-playbook -i,localhost geocml-server-playbook.yaml --tags "all" && rm -f ./*.yaml +RUN ansible-galaxy collection install ansible.posix && ansible-galaxy install -r geocml-server-requirements.yaml && ansible-playbook -i,localhost geocml-server-playbook.yaml --tags "all" && rm -f ./*.yaml # Copy portal source to container ADD ./build-resources/geocml-server/portal/ /var/www/html/ diff --git a/Dockerfiles/Dockerfile.geocml-task-scheduler b/Dockerfiles/Dockerfile.geocml-task-scheduler index 4ef32c8..729bc71 100644 --- a/Dockerfiles/Dockerfile.geocml-task-scheduler +++ b/Dockerfiles/Dockerfile.geocml-task-scheduler @@ -1,11 +1,12 @@ -FROM ubuntu:latest +FROM ubuntu:22.04 USER root RUN apt update -y + # Install Python and Pip -RUN apt install -y python3 && apt install -y python3-pip +RUN apt install -y python3-pip && pip install psycopg2-binary -# Install psycopg2-binary +# Install psycopg2-binary RUN pip install psycopg2-binary # Create task_log file diff --git a/ansible-playbooks/geocml-postgres-playbook.yaml b/ansible-playbooks/geocml-postgres-playbook.yaml index 329bb63..ad96c0f 100644 --- a/ansible-playbooks/geocml-postgres-playbook.yaml +++ b/ansible-playbooks/geocml-postgres-playbook.yaml @@ -61,7 +61,7 @@ become_user: postgres community.postgresql.postgresql_set: name: listen_addresses - value: '*' + value: "*" - name: Add PostGIS extension to geocml_db become_user: postgres community.postgresql.postgresql_ext: @@ -73,4 +73,3 @@ state: restarted name: postgresql use: service -... \ No newline at end of file diff --git a/ansible-playbooks/geocml-postgres-requirements.yaml b/ansible-playbooks/geocml-postgres-requirements.yaml index dae1395..d903d63 100644 --- a/ansible-playbooks/geocml-postgres-requirements.yaml +++ b/ansible-playbooks/geocml-postgres-requirements.yaml @@ -1,13 +1,12 @@ --- # Add Ansible Galaxy Packages here, role_example_hello included to prevent errors in template testing -# NOTE: Uncomment the two lines below if you want to test your Ansible installation -# before proceeding with the rest of the playbook. +# NOTE: Uncomment the two lines below if you want to test your Ansible installation +# before proceeding with the rest of the playbook. # # This is typically only necessary if you are changing the default Ansible installation # that comes with the geoCML base image. #roles: #- irixjp.role_example_hello # https://galaxy.ansible.com/irixjp/role_example_hello collections: -- community.postgresql # https://galaxy.ansible.com/community/postgresql -... + - community.postgresql # https://galaxy.ansible.com/community/postgresql diff --git a/ansible-playbooks/geocml-server-playbook.yaml b/ansible-playbooks/geocml-server-playbook.yaml index d1518e7..d28a410 100644 --- a/ansible-playbooks/geocml-server-playbook.yaml +++ b/ansible-playbooks/geocml-server-playbook.yaml @@ -8,9 +8,9 @@ - name: Enable cgid community.general.apache2_module: state: present - name: cgid + name: cgid force: true - - name: Enable fcgid + - name: Enable fcgid community.general.apache2_module: state: present name: fcgid @@ -23,4 +23,3 @@ ansible.builtin.command: mkdir -p /home/qgis/qgisserverdb - name: Change qgisserverdb dir's owner to www-data ansible.builtin.command: chown www-data:www-data /home/qgis/qgisserverdb -... \ No newline at end of file diff --git a/ansible-playbooks/geocml-server-requirements.yaml b/ansible-playbooks/geocml-server-requirements.yaml index 0194baa..b0d9299 100644 --- a/ansible-playbooks/geocml-server-requirements.yaml +++ b/ansible-playbooks/geocml-server-requirements.yaml @@ -1,13 +1,12 @@ --- # Add Ansible Galaxy Packages here, role_example_hello included to prevent errors in template testing -# NOTE: Uncomment the two lines below if you want to test your Ansible installation -# before proceeding with the rest of the playbook. +# NOTE: Uncomment the two lines below if you want to test your Ansible installation +# before proceeding with the rest of the playbook. # # This is typically only necessary if you are changing the default Ansible installation # that comes with the geoCML base image. #roles: #- irixjp.role_example_hello # https://galaxy.ansible.com/irixjp/role_example_hello collections: -- community.general -... + - community.general diff --git a/docker-compose.yml b/docker-compose.yml index 8cbd919..e78a97d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: geocml-task-scheduler: - build: + build: context: . dockerfile: ./Dockerfiles/Dockerfile.geocml-task-scheduler image: ghcr.io/geocml/geocml-base-deployment:task-scheduler @@ -14,6 +14,7 @@ services: source: ./persistence-layer/DBBackups target: /DBBackups geocml-desktop: + platform: linux/amd64 build: context: . dockerfile: ./Dockerfiles/Dockerfile.geocml-desktop