From 32e0f50765b2b447da7e89b1de805e8abe04bb06 Mon Sep 17 00:00:00 2001 From: Shihaam Abdul Rahman Date: Sat, 19 Oct 2024 02:33:10 +0500 Subject: [PATCH] add docker build files --- .build/prod/api.Dockerfile | 8 ++++++++ .build/prod/compose.yml | 11 +++++++++++ .build/prod/keepalive.Dockerfile | 10 ++++++++++ 3 files changed, 29 insertions(+) create mode 100644 .build/prod/api.Dockerfile create mode 100644 .build/prod/compose.yml create mode 100644 .build/prod/keepalive.Dockerfile diff --git a/.build/prod/api.Dockerfile b/.build/prod/api.Dockerfile new file mode 100644 index 0000000..2260b89 --- /dev/null +++ b/.build/prod/api.Dockerfile @@ -0,0 +1,8 @@ +FROM python:3.9.20-slim-bookworm + +RUN pip install python-dotenv flask + +WORKDIR /app +COPY api.py tx.sh . + +CMD python /app/api.py diff --git a/.build/prod/compose.yml b/.build/prod/compose.yml new file mode 100644 index 0000000..23b1633 --- /dev/null +++ b/.build/prod/compose.yml @@ -0,0 +1,11 @@ +services: + keepalive: + build: + context: ../../ + dockerfile: .build/prod/keepalive.Dockerfile + image: git.shihaam.dev/shihaam/mib-payment-verify/keepalive + api: + build: + context: ../../ + dockerfile: .build/prod/api.Dockerfile + image: git.shihaam.dev/shihaam/mib-payment-verify/api diff --git a/.build/prod/keepalive.Dockerfile b/.build/prod/keepalive.Dockerfile new file mode 100644 index 0000000..b02d37b --- /dev/null +++ b/.build/prod/keepalive.Dockerfile @@ -0,0 +1,10 @@ +FROM debian:bullseye-slim + +RUN apt-get update && apt-get install -y curl && apt-get clean && rm -rf /var/lib/apt/lists/* + +WORKDIR /app +COPY keepalive.sh . + +RUN chmod +x keepalive.sh + +CMD /app/keepalive.sh