Skip to content

Commit

Permalink
Merge pull request #70 from geoCML/refactor-update-base-image-versions
Browse files Browse the repository at this point in the history
Slight refactor, update base image versions
  • Loading branch information
TristanDamron authored Aug 1, 2024
2 parents 397a266 + e68f4da commit 8e0c3e7
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 22 deletions.
6 changes: 3 additions & 3 deletions Dockerfiles/Dockerfile.geocml-postgres
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:latest
FROM ubuntu:22.04
USER root

RUN apt update
Expand All @@ -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 ###########
Expand Down
4 changes: 2 additions & 2 deletions Dockerfiles/Dockerfile.geocml-server
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:latest
FROM ubuntu:22.04

RUN apt update

Expand All @@ -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/
Expand Down
7 changes: 4 additions & 3 deletions Dockerfiles/Dockerfile.geocml-task-scheduler
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions ansible-playbooks/geocml-postgres-playbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -73,4 +73,3 @@
state: restarted
name: postgresql
use: service
...
7 changes: 3 additions & 4 deletions ansible-playbooks/geocml-postgres-requirements.yaml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 2 additions & 3 deletions ansible-playbooks/geocml-server-playbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
...
7 changes: 3 additions & 4 deletions ansible-playbooks/geocml-server-requirements.yaml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -14,6 +14,7 @@ services:
source: ./persistence-layer/DBBackups
target: /DBBackups
geocml-desktop:
platform: linux/amd64
build:
context: .
dockerfile: ./Dockerfiles/Dockerfile.geocml-desktop
Expand Down

0 comments on commit 8e0c3e7

Please sign in to comment.