Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Dockerfile and docker-compose.yml #181

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Dedsec0098 committed Jan 18, 2025
commit e6762e845ba36aaec5cd52c1aed9bda4a7aacb88
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
27 changes: 27 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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: