diff --git a/docker-compose.yaml b/docker-compose.yaml index ba71436..9d40c46 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,7 +2,7 @@ version: '3' services: source_postgres: - image: postgres:latest + image: postgres:16.2 ports: - "5433:5432" networks: @@ -15,7 +15,7 @@ services: - ./source_db_init/init.sql:/docker-entrypoint-initdb.d/init.sql destination_postgres: - image: postgres:latest + image: postgres:16.2 ports: - "5434:5432" networks: diff --git a/elt_script/Dockerfile b/elt_script/Dockerfile index c1ede26..252acd6 100644 --- a/elt_script/Dockerfile +++ b/elt_script/Dockerfile @@ -1,10 +1,17 @@ FROM python:3.8-slim -# Install PostgreSQL command-line tools -RUN apt-get update && apt-get install -y postgresql-client +# Install the dependencies for the PostgreSQL repository +RUN apt-get update && apt-get install -y wget gnupg + +# Add the PostgreSQL repository to get the latest PostgreSQL client +RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ $(. /etc/os-release; echo $VERSION_CODENAME)-pgdg main" > /etc/apt/sources.list.d/pgdg.list \ + && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - + +# Install PostgreSQL client version 16 +RUN apt-get update && apt-get install -y postgresql-client-16 # Copy the ELT script COPY elt_script.py . # Set the default command to run the ELT script -CMD ["python", "elt_script.py"] \ No newline at end of file +CMD ["python", "elt_script.py"]