Skip to content

Commit

Permalink
Rebuild image for pg14
Browse files Browse the repository at this point in the history
  • Loading branch information
conbrad committed Feb 12, 2024
1 parent 8592eb2 commit dbee672
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
16 changes: 6 additions & 10 deletions openshift/s3-backup/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
FROM centos/postgresql-12-centos7
FROM postgres:14

# Set the locale (important for poetry)
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

RUN apt-get update && apt-get -y install unzip

# Download the Amazon CLI installer.
ADD "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" /tmp/awscliv2.zip

Expand All @@ -13,22 +15,16 @@ USER root
RUN unzip /tmp/awscliv2.zip -d /tmp/ &&\
/tmp/aws/install

RUN yum install -y python3 python3-setuptools
RUN apt-get -y install python3 python3-setuptools python3-pip

# Install poetry.
# This is not the recommended way to install poetry, but it works.
RUN pip3 install --upgrade pip setuptools wheel
RUN pip3 install --upgrade poetry
RUN pip3 install poetry --break-system-packages

# Getting poetry to play nice with centos in openshift is a nightmare, so we just
# take the easy route and create a requirements.txt file.
COPY pyproject.toml poetry.lock /tmp/
RUN cd /tmp && \
python3 -m poetry export -f requirements.txt --output requirements.txt && \
pip3 install -r requirements.txt

# Switch back to default user - 26 is the postgres user.
USER 26
pip3 install -r requirements.txt --break-system-packages

# Copy scripts.
COPY backup_to_s3.sh .
Expand Down
2 changes: 1 addition & 1 deletion openshift/templates/backup-s3-postgres-cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ parameters:
value: wps-global
- name: CLUSTER_NAME
description: |
The name of the patroni cluster to connect to.
The name of the postgres cluster to connect to.
displayName: Server Name
required: true
objects:
Expand Down

0 comments on commit dbee672

Please sign in to comment.