Add database container image build

This commit is contained in:
phil 2024-12-06 05:03:55 +01:00
parent 425aaf9dc0
commit 48507cc01c
2 changed files with 27 additions and 1 deletions

4
Containerfile.database Normal file
View file

@ -0,0 +1,4 @@
FROM docker.io/postgis/postgis:17-3.5-alpine
ENV POSTGRES_USER treetrail
ENV POSTGRES_PASSWORD treetrail

View file

@ -13,17 +13,37 @@
# file: prod.yaml # file: prod.yaml
# name: conf # name: conf
- name: Build the database image
tags: db
containers.podman.podman_image:
name: treetrail-database
state: build
path: "{{ playbook_dir }}"
build:
format: oci
force_rm: "{{ force_rm }}"
cache: "{{ cache }}"
file: Containerfile.database
push: true
push_args:
dest: "{{ repository }}/{{ organisation }}"
- name: Using the variables - name: Using the variables
ansible.builtin.debug: ansible.builtin.debug:
var: force_rm var: force_rm
- name: Get the version from git - name: Get the version from git
tags:
- ci
- deps
- backend
command: git describe --dirty --tags command: git describe --dirty --tags
register: version register: version
args: args:
chdir: "{{ playbook_dir }}" chdir: "{{ playbook_dir }}"
- name: Build the base CI image - name: Build the base CI image
tags: ci
containers.podman.podman_image: containers.podman.podman_image:
name: treetrail-backend-ci name: treetrail-backend-ci
tag: "{{ version.stdout }}" tag: "{{ version.stdout }}"
@ -36,9 +56,10 @@
file: Containerfile.ci file: Containerfile.ci
push: true push: true
push_args: push_args:
dest: "{{ repository }}/{{ organisation }}/treetrail-backend-ci" dest: "{{ repository }}/{{ organisation }}"
- name: Build the base image, only with python dependencies - name: Build the base image, only with python dependencies
tags: deps
containers.podman.podman_image: containers.podman.podman_image:
name: treetrail-backend-deps name: treetrail-backend-deps
tag: "{{ version.stdout }}" tag: "{{ version.stdout }}"
@ -54,6 +75,7 @@
dest: "{{ repository }}/{{ organisation }}" dest: "{{ repository }}/{{ organisation }}"
- name: Build the backend container image - name: Build the backend container image
tags: backend
containers.podman.podman_image: containers.podman.podman_image:
name: treetrail-backend name: treetrail-backend
tag: "{{ version.stdout }}" tag: "{{ version.stdout }}"