Makefile: version_code bugfix; Compose: author name bugfix; Readme
This commit is contained in:
parent
c67b5929cb
commit
db341384a0
3 changed files with 30 additions and 19 deletions
14
Makefile
14
Makefile
|
@ -14,14 +14,24 @@ check:
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
python3 -m dotenv -f version_code run \
|
python3 -m dotenv -f version_code run \
|
||||||
docker build -t ${REPO_OWNER_LOWER}/${REPO_NAME_SNAKE}:$$VERSION .
|
make cmd-docker-build
|
||||||
|
|
||||||
|
docker-build:
|
||||||
|
python3 -m dotenv -f version_code run \
|
||||||
|
make cmd-docker-build
|
||||||
|
|
||||||
docker-push:
|
docker-push:
|
||||||
python3 -m dotenv -f version_code run \
|
python3 -m dotenv -f version_code run \
|
||||||
docker push ${REPO_OWNER_LOWER}/${REPO_NAME_SNAKE}:$$VERSION
|
make cmd-docker-push
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf app/__pycache__
|
rm -rf app/__pycache__
|
||||||
rm -rf app/*/__pycache__
|
rm -rf app/*/__pycache__
|
||||||
rm -rf __pycache__
|
rm -rf __pycache__
|
||||||
rm -rf .mypy_cache
|
rm -rf .mypy_cache
|
||||||
|
|
||||||
|
cmd-docker-build:
|
||||||
|
docker build -t ${REPO_OWNER_LOWER}/${REPO_NAME_SNAKE}:$${VERSION} .
|
||||||
|
|
||||||
|
cmd-docker-push:
|
||||||
|
docker push ${REPO_OWNER_LOWER}/${REPO_NAME_SNAKE}:$$VERSION
|
||||||
|
|
33
README.md
33
README.md
|
@ -46,7 +46,8 @@ Make commands:
|
||||||
|`make check`|Check the code with linters (MyPy, Pylint)|
|
|`make check`|Check the code with linters (MyPy, Pylint)|
|
||||||
|`make dev`|Run the app in development mode|
|
|`make dev`|Run the app in development mode|
|
||||||
|`make prod`|Run a production server|
|
|`make prod`|Run a production server|
|
||||||
|`make docker`|Build a docker image from `Dockerfile`|
|
|`make docker` or `make docker-build`|Build a docker image from `Dockerfile`|
|
||||||
|
|`make docker-push`|Upload the built image to Docker Hub|
|
||||||
|`make clean`|Clean all cache|
|
|`make clean`|Clean all cache|
|
||||||
|
|
||||||
|
|
||||||
|
@ -177,8 +178,8 @@ or call `with_redirect_307` function.
|
||||||
to the Response contructor.
|
to the Response contructor.
|
||||||
|
|
||||||
**Args:**
|
**Args:**
|
||||||
url (str, optional): Target URL, root by default
|
- url (str, optional): Target URL, root by default
|
||||||
code (int, optional): HTTP response code
|
- code (int, optional): HTTP response code
|
||||||
|
|
||||||
**Returns:** FastAPI's RedirectResponse object
|
**Returns:** FastAPI's RedirectResponse object
|
||||||
|
|
||||||
|
@ -198,8 +199,8 @@ Return a plain text to the user.
|
||||||
to the Response contructor.
|
to the Response contructor.
|
||||||
|
|
||||||
**Args:**
|
**Args:**
|
||||||
content (str): Plain text content
|
- content (str): Plain text content
|
||||||
code (int, optional): HTTP response code
|
- code (int, optional): HTTP response code
|
||||||
|
|
||||||
**Returns:** FastAPI's PlainTextResponse object
|
**Returns:** FastAPI's PlainTextResponse object
|
||||||
|
|
||||||
|
@ -225,12 +226,12 @@ to your function if you specify
|
||||||
the correct type hint (`: Request`)
|
the correct type hint (`: Request`)
|
||||||
|
|
||||||
**Args:**
|
**Args:**
|
||||||
name (str): Template filename
|
- name (str): Template filename
|
||||||
request (Request): FastAPI request object
|
- request (Request): FastAPI request object
|
||||||
code (int, optional): HTTP response code
|
- code (int, optional): HTTP response code
|
||||||
headers (Optional[Mapping[str, str]], optional):
|
- headers (Optional[Mapping[str, str]], optional):
|
||||||
Additional headers, passed to the Response constructor
|
Additional headers, passed to the Response constructor
|
||||||
background (Optional[BackgroundTask], optional):
|
- background (Optional[BackgroundTask], optional):
|
||||||
Background task, passed to the Response constructor
|
Background task, passed to the Response constructor
|
||||||
|
|
||||||
**Returns:** FastAPI's TemplateResponse object
|
**Returns:** FastAPI's TemplateResponse object
|
||||||
|
@ -242,9 +243,9 @@ automatically guessing its mimetype if `mime` is None.
|
||||||
to the Response contructor.
|
to the Response contructor.
|
||||||
|
|
||||||
**Args:**
|
**Args:**
|
||||||
path (os.PathLike): File path
|
- path (os.PathLike): File path
|
||||||
mime (Optional[str], optional): File mimetype
|
- mime (Optional[str], optional): File mimetype
|
||||||
code (int, optional): HTTP response code
|
- code (int, optional): HTTP response code
|
||||||
|
|
||||||
**Returns:** FileResponse: FastAPI's FileResponse object
|
**Returns:** FileResponse: FastAPI's FileResponse object
|
||||||
|
|
||||||
|
@ -259,8 +260,8 @@ See `respond.with_tmpl` for explanation
|
||||||
about the `request` argument.
|
about the `request` argument.
|
||||||
|
|
||||||
**Args:**
|
**Args:**
|
||||||
form (Type[StarletteForm]): StarletteForm class
|
- form (Type[StarletteForm]): StarletteForm class
|
||||||
req (Request): Request object
|
- req (Request): Request object
|
||||||
|
|
||||||
**Returns:** StarletteForm instance
|
**Returns:** StarletteForm instance
|
||||||
|
|
||||||
|
@ -275,7 +276,7 @@ Code is copied from the official docs.
|
||||||
|
|
||||||
## Publishing app
|
## Publishing app
|
||||||
First of all, check the `version_code` file and correct it if needed,
|
First of all, check the `version_code` file and correct it if needed,
|
||||||
Then build a Docker image using `make docker` command.
|
then build a Docker image using `make docker` command.
|
||||||
|
|
||||||
Follow [this documentation page](https://docs.docker.com/get-started/04_sharing_app/)
|
Follow [this documentation page](https://docs.docker.com/get-started/04_sharing_app/)
|
||||||
to create an account in the Docker Hub.
|
to create an account in the Docker Hub.
|
||||||
|
|
|
@ -2,7 +2,7 @@ version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
${REPO_NAME_SNAKE}:
|
${REPO_NAME_SNAKE}:
|
||||||
image: ${REPO_OWNER}/${REPO_NAME_SNAKE}:latest
|
image: ${REPO_OWNER_LOWER}/${REPO_NAME_SNAKE}:latest
|
||||||
container_name: ${REPO_NAME_SNAKE}
|
container_name: ${REPO_NAME_SNAKE}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
|
|
Loading…
Add table
Reference in a new issue