-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 [email protected]
- Loading branch information
1 parent
53497a3
commit e6762e8
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |