From 7c22119db2d7578c2d9cd8aac18abd5bb20af916 Mon Sep 17 00:00:00 2001 From: Mattia Procopio Date: Wed, 15 May 2024 14:01:22 +0200 Subject: [PATCH] Dockerize the tool (#2) --- Dockerfile | 35 +++++++++++++++++++ .../{config.yaml => config.example.yaml} | 0 2 files changed, 35 insertions(+) create mode 100644 Dockerfile rename pg-migration-tool/{config.yaml => config.example.yaml} (100%) diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bf41330 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +FROM python:3.12.3-slim-bookworm + +ARG CONFIG_PATH=pg-migration-tool/config.example.yaml + +ENV TERM=xterm-256color + +ENV COLORTERM=truecolor + +RUN apt-get update && apt-get -y upgrade + +RUN apt-get install -y libpq-dev gcc xterm + +RUN pip install pipenv + +RUN useradd -m pgmigrator + +USER pgmigrator + +WORKDIR /app + +COPY Pipfile ./ + +COPY Pipfile.lock ./ + +COPY pg-migration-tool/main.py ./pg-migration-tool/ + +COPY pg-migration-tool/select.tcss ./pg-migration-tool/ + +COPY $CONFIG_PATH ./pg-migration-tool/config.yaml + +RUN pipenv install + +ENTRYPOINT ["pipenv", "run", "python"] + +CMD ["pg-migration-tool/main.py"] diff --git a/pg-migration-tool/config.yaml b/pg-migration-tool/config.example.yaml similarity index 100% rename from pg-migration-tool/config.yaml rename to pg-migration-tool/config.example.yaml