-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e9135a
commit b606dbf
Showing
12 changed files
with
612 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,21 @@ | ||
__pycache__ | ||
*.pyc | ||
*.pyo | ||
*.pyd | ||
.Python | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
.tox | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.log | ||
.mypy_cache | ||
.pytest_cache | ||
.hypothesis | ||
.git/ | ||
.idea/ | ||
venv/ |
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,24 @@ | ||
.idea | ||
.ipynb_checkpoints | ||
.mypy_cache | ||
.vscode | ||
__pycache__ | ||
.pytest_cache | ||
htmlcov | ||
dist | ||
site | ||
.coverage | ||
coverage.xml | ||
.netlify | ||
test.db | ||
log.txt | ||
*.log | ||
Pipfile.lock | ||
env3.* | ||
env | ||
.env | ||
docs_build | ||
venv/ | ||
docs.zip | ||
archive.zip | ||
migrations/versions/* |
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,18 @@ | ||
FROM python:3.11-alpine | ||
|
||
ENV PYTHONUNBUFFERED=1 | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
|
||
WORKDIR /phonebook-app | ||
|
||
RUN apk update | ||
RUN pip install --upgrade pip | ||
|
||
COPY requirements.txt . | ||
RUN pip install --no-cache-dir --upgrade -r /phonebook-app/requirements.txt | ||
|
||
COPY . . | ||
|
||
ENV PYTHONPATH="${PYTHONPATH}:/phonebook-app/src" | ||
|
||
LABEL maintainer="paralepsis <[email protected]>" |
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,15 @@ | ||
version: '3.3' | ||
|
||
services: | ||
api: | ||
build: . | ||
container_name: phonebook-api | ||
command: python3 src/core/main.py | ||
restart: unless-stopped | ||
ports: | ||
- "8001:8001" | ||
volumes: | ||
- .:/phonebook-app | ||
|
||
networks: | ||
phonebook-app: |
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,7 @@ | ||
python-dotenv==1.0.0 | ||
pydantic==1.10.7 | ||
aiofiles==23.2.1 | ||
aiohttp==3.8.5 | ||
typer[all]==0.9.0 | ||
tabulate==0.9.0 | ||
PyYAML==6.0.1 |
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,7 @@ | ||
# Name of database (JSON file) to create and use as phonebook. | ||
# Don't specify the path, just specify the name, the path will be formed automatically. | ||
DB_NAME=phonebook.json | ||
|
||
# Host and port for aiohttp REST API server. | ||
HOST=127.0.0.1 | ||
PORT=8001 |
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,15 @@ | ||
import os | ||
from pathlib import Path | ||
from dotenv import load_dotenv | ||
|
||
load_dotenv(dotenv_path='.env-example') | ||
|
||
# The root directory of the project from which all paths will be formed. | ||
BASE_DIR: Path = Path(__file__).resolve().parent.parent | ||
|
||
DB_NAME: str = os.environ.get("DB_NAME") | ||
DB_LOCATION: Path = BASE_DIR / "db/data" / DB_NAME | ||
|
||
HOST: str = os.environ.get("HOST") | ||
PORT: int | str = os.environ.get("PORT") | ||
SERVER_URL: str = f'http://{HOST}:{PORT}' |
Oops, something went wrong.