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:
|
||||
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:
|
||||
python3 -m dotenv -f version_code run \
|
||||
docker push ${REPO_OWNER_LOWER}/${REPO_NAME_SNAKE}:$$VERSION
|
||||
make cmd-docker-push
|
||||
|
||||
clean:
|
||||
rm -rf app/__pycache__
|
||||
rm -rf app/*/__pycache__
|
||||
rm -rf __pycache__
|
||||
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 dev`|Run the app in development mode|
|
||||
|`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|
|
||||
|
||||
|
||||
|
@ -177,8 +178,8 @@ or call `with_redirect_307` function.
|
|||
to the Response contructor.
|
||||
|
||||
**Args:**
|
||||
url (str, optional): Target URL, root by default
|
||||
code (int, optional): HTTP response code
|
||||
- url (str, optional): Target URL, root by default
|
||||
- code (int, optional): HTTP response code
|
||||
|
||||
**Returns:** FastAPI's RedirectResponse object
|
||||
|
||||
|
@ -198,8 +199,8 @@ Return a plain text to the user.
|
|||
to the Response contructor.
|
||||
|
||||
**Args:**
|
||||
content (str): Plain text content
|
||||
code (int, optional): HTTP response code
|
||||
- content (str): Plain text content
|
||||
- code (int, optional): HTTP response code
|
||||
|
||||
**Returns:** FastAPI's PlainTextResponse object
|
||||
|
||||
|
@ -225,12 +226,12 @@ to your function if you specify
|
|||
the correct type hint (`: Request`)
|
||||
|
||||
**Args:**
|
||||
name (str): Template filename
|
||||
request (Request): FastAPI request object
|
||||
code (int, optional): HTTP response code
|
||||
headers (Optional[Mapping[str, str]], optional):
|
||||
- name (str): Template filename
|
||||
- request (Request): FastAPI request object
|
||||
- code (int, optional): HTTP response code
|
||||
- headers (Optional[Mapping[str, str]], optional):
|
||||
Additional headers, passed to the Response constructor
|
||||
background (Optional[BackgroundTask], optional):
|
||||
- background (Optional[BackgroundTask], optional):
|
||||
Background task, passed to the Response constructor
|
||||
|
||||
**Returns:** FastAPI's TemplateResponse object
|
||||
|
@ -242,9 +243,9 @@ automatically guessing its mimetype if `mime` is None.
|
|||
to the Response contructor.
|
||||
|
||||
**Args:**
|
||||
path (os.PathLike): File path
|
||||
mime (Optional[str], optional): File mimetype
|
||||
code (int, optional): HTTP response code
|
||||
- path (os.PathLike): File path
|
||||
- mime (Optional[str], optional): File mimetype
|
||||
- code (int, optional): HTTP response code
|
||||
|
||||
**Returns:** FileResponse: FastAPI's FileResponse object
|
||||
|
||||
|
@ -259,8 +260,8 @@ See `respond.with_tmpl` for explanation
|
|||
about the `request` argument.
|
||||
|
||||
**Args:**
|
||||
form (Type[StarletteForm]): StarletteForm class
|
||||
req (Request): Request object
|
||||
- form (Type[StarletteForm]): StarletteForm class
|
||||
- req (Request): Request object
|
||||
|
||||
**Returns:** StarletteForm instance
|
||||
|
||||
|
@ -275,7 +276,7 @@ Code is copied from the official docs.
|
|||
|
||||
## Publishing app
|
||||
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/)
|
||||
to create an account in the Docker Hub.
|
||||
|
|
|
@ -2,7 +2,7 @@ version: "3"
|
|||
|
||||
services:
|
||||
${REPO_NAME_SNAKE}:
|
||||
image: ${REPO_OWNER}/${REPO_NAME_SNAKE}:latest
|
||||
image: ${REPO_OWNER_LOWER}/${REPO_NAME_SNAKE}:latest
|
||||
container_name: ${REPO_NAME_SNAKE}
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
|
|
Loading…
Add table
Reference in a new issue