From e6762e845ba36aaec5cd52c1aed9bda4a7aacb88 Mon Sep 17 00:00:00 2001 From: Shrish0098 Date: Sat, 18 Jan 2025 16:55:43 +0530 Subject: [PATCH] Added Dockerfile and docker-compose.yml I have added dockerfile which will make containerization easy for both developers and users to get the project up and running in any environment. Signed-off-by: Shrish Mishra shrish409@gmail.com --- Dockerfile | 11 +++++++++++ docker-compose.yml | 27 +++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b37558d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM python:3.10-slim + +WORKDIR /app + +COPY . . + +RUN pip install --no-cache-dir -r requirements.txt + +EXPOSE 8000 + +CMD ["python", "about.py"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..4f397cb --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,27 @@ +version: "3.8" + +services: + aboutcode: + build: + context: . + container_name: aboutcode-container + ports: + - "8000:8000" + volumes: + - .:/app + depends_on: + - db + command: python about.py + + db: + image: postgres:14 + container_name: aboutcode-db + environment: + POSTGRES_USER: user + POSTGRES_PASSWORD: password + POSTGRES_DB: aboutcode + volumes: + - db_data:/var/lib/postgresql/data + +volumes: + db_data: