diff --git a/Dockerfile b/Dockerfile index ce76d13..584ec1f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,6 @@ -FROM ubuntu:18.04 +FROM postgres:16 RUN apt update && apt install -y wget gnupg pigz pbzip2 xz-utils lrzip brotli zstd \ - && wget -qO - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ - && echo "deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main" | tee /etc/apt/sources.list.d/postgresql.list \ - && apt update && apt install -y postgresql-client \ && wget https://dl.minio.io/client/mc/release/linux-amd64/mc -O /sbin/mc && chmod +x /sbin/mc \ && apt remove -y wget && apt autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/docker-compose.test.yml b/docker-compose.test.yml new file mode 100644 index 0000000..d247b97 --- /dev/null +++ b/docker-compose.test.yml @@ -0,0 +1,45 @@ +version: "3.9" + +volumes: + minio_data: + postgres_data: + +services: + postgres-backup: + image: backuptools/postgres-backup-s3 + restart: no + build: . + environment: + - S3_BUCK=test-backup + - S3_NAME=folder-name/backup-name-prefix + - S3_URI=http://minio:minio123@minio:9000 + - PG_URI=postgres://postgres:postgres@postgres:5432/postgres + # Available: pigz, xz, bzip2, lrzip, brotli, zstd + - COMPRESS=pigz + depends_on: + - minio + - postgres + entrypoint: "" + command: "/bin/sh -c 'while :; do sleep 10s && ./entrypoint.sh; done'" + + + minio: + image: minio/minio + volumes: + - minio_data:/data + environment: + MINIO_ROOT_USER: minio + MINIO_ROOT_PASSWORD: minio123 + command: server /data --console-address ":9001" --address 0.0.0.0:9000 + + postgres: + image: postgres:15-alpine + environment: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: postgres + volumes: + - postgres_data:/var/lib/postgresql/data + - ./test-init.sql:/docker-entrypoint-initdb.d/init-dump.sql + ports: + - "5434:5432" \ No newline at end of file