mirror of
https://github.com/PokeAPI/pokeapi
synced 2024-11-24 20:33:04 +00:00
Merge branch 'master' into deploy-gql
This commit is contained in:
commit
06048a97df
5 changed files with 33 additions and 33 deletions
|
@ -18,7 +18,7 @@ graphql
|
|||
.vscode
|
||||
.github
|
||||
.circleci
|
||||
docker-compose.yml
|
||||
docker-compose*
|
||||
.dockerignore
|
||||
/*.md
|
||||
/*.js
|
||||
|
|
20
Makefile
20
Makefile
|
@ -46,38 +46,38 @@ openapi-generate:
|
|||
python manage.py spectacular --color --file openapi.yml ${local_config}
|
||||
|
||||
docker-up: # (Docker) Create services/volumes/networks
|
||||
docker-compose up -d
|
||||
docker compose up -d
|
||||
|
||||
docker-migrate: # (Docker) Run any pending migrations
|
||||
docker-compose exec -T app python manage.py migrate ${docker_config}
|
||||
docker compose exec -T app python manage.py migrate ${docker_config}
|
||||
|
||||
docker-build-db: # (Docker) Build the database
|
||||
docker-compose exec -T app sh -c 'echo "from data.v2.build import build_all; build_all()" | python manage.py shell ${docker_config}'
|
||||
docker compose exec -T app sh -c 'echo "from data.v2.build import build_all; build_all()" | python manage.py shell ${docker_config}'
|
||||
|
||||
docker-make-migrations: # (Docker) Create migrations files if schema has changed
|
||||
docker-compose exec -T app sh -c 'python manage.py makemigrations ${docker_config}'
|
||||
docker compose exec -T app sh -c 'python manage.py makemigrations ${docker_config}'
|
||||
|
||||
docker-flush-db: # (Docker) Removes all the data present in the database but preserves tables and migrations
|
||||
docker-compose exec -T app sh -c 'python manage.py flush --no-input ${docker_config}'
|
||||
docker compose exec -T app sh -c 'python manage.py flush --no-input ${docker_config}'
|
||||
|
||||
docker-destroy-db: # (Docker) Removes the volume where the database is installed on, alongside to the container itself
|
||||
docker rm -f pokeapi_db_1
|
||||
docker volume rm pokeapi_pg_data
|
||||
|
||||
docker-shell: # (Docker) Launch an interative shell for the pokeapi container
|
||||
docker-compose exec app sh -l
|
||||
docker compose exec app sh -l
|
||||
|
||||
docker-stop: # (Docker) Stop containers
|
||||
docker-compose stop
|
||||
docker compose stop
|
||||
|
||||
docker-down: # (Docker) Stop and removes containers and networks
|
||||
docker-compose down
|
||||
docker compose down
|
||||
|
||||
docker-test: # (Docker) Run tests
|
||||
docker-compose exec -T app python manage.py test ${local_config}
|
||||
docker compose exec -T app python manage.py test ${local_config}
|
||||
|
||||
docker-prod:
|
||||
docker-compose -f docker-compose.yml -f docker-compose.override.yml -f Resources/compose/docker-compose-prod-graphql.yml up -d
|
||||
docker compose -f docker-compose.yml -f docker-compose.override.yml -f Resources/compose/docker-compose-prod-graphql.yml up -d
|
||||
|
||||
docker-setup: docker-up docker-migrate docker-build-db # (Docker) Start services, prepare the latest DB schema, populate the DB
|
||||
|
||||
|
|
40
README.md
40
README.md
|
@ -72,7 +72,7 @@ Run `make help` to see all tasks.
|
|||
|
||||
## Docker and Compose [![docker hub](https://img.shields.io/docker/v/pokeapi/pokeapi?label=tag&sort=semver)](https://hub.docker.com/r/pokeapi/pokeapi)
|
||||
|
||||
There is also a multi-container setup, managed by [Docker Compose](https://docs.docker.com/compose/). This setup allows you to deploy a production-like environment, with separate containers for each service, and is recommended if you need to simply spin up PokéAPI.
|
||||
There is also a multi-container setup, managed by [Docker Compose V2](https://docs.docker.com/compose/). This setup allows you to deploy a production-like environment, with separate containers for each service, and is recommended if you need to simply spin up PokéAPI.
|
||||
|
||||
Start everything by
|
||||
|
||||
|
@ -83,9 +83,9 @@ make docker-setup
|
|||
If you don't have `make` on your machine you can use the following commands
|
||||
|
||||
```sh
|
||||
docker-compose up -d
|
||||
docker-compose exec -T app python manage.py migrate --settings=config.docker-compose
|
||||
docker-compose exec -T app sh -c 'echo "from data.v2.build import build_all; build_all()" | python manage.py shell --settings=config.docker-compose'
|
||||
docker compose up -d
|
||||
docker compose exec -T app python manage.py migrate --settings=config.docker-compose
|
||||
docker compose exec -T app sh -c 'echo "from data.v2.build import build_all; build_all()" | python manage.py shell --settings=config.docker-compose'
|
||||
```
|
||||
|
||||
Browse [localhost/api/v2/](http://localhost/api/v2/) or [localhost/api/v2/pokemon/bulbasaur/](http://localhost/api/v2/pokemon/bulbasaur/) on port `80`.
|
||||
|
@ -105,7 +105,7 @@ make docker-migrate
|
|||
|
||||
## GraphQL <a href="ttps://github.com/hasura/graphql-engine"><img height="29px" src="https://graphql-engine-cdn.hasura.io/img/powered_by_hasura_blue.svg"/></a>
|
||||
|
||||
When you start PokéAPI with the above docker-compose setup, an [Hasura Engine](https://github.com/hasura/graphql-engine) server is started as well. It's possible to track all the PokeAPI tables and foreign keys by simply
|
||||
When you start PokéAPI with the above Docker Compose setup, an [Hasura Engine](https://github.com/hasura/graphql-engine) server is started as well. It's possible to track all the PokeAPI tables and foreign keys by simply
|
||||
|
||||
```sh
|
||||
# hasura cli needs to be installed and available in your $PATH: https://hasura.io/docs/latest/graphql/core/hasura-cli/install-hasura-cli.html
|
||||
|
@ -153,24 +153,24 @@ This k8s setup creates all k8s resources inside the _Namespace_ `pokeapi`, run `
|
|||
| Python 2/3 | [PokeAPI/pokepy](https://github.com/PokeAPI/pokepy) | _Auto caching_ |
|
||||
| Python 3 | [PokeAPI/pokebase](https://github.com/PokeAPI/pokebase) | _Auto caching_, _Image caching_ |
|
||||
|
||||
|Wrapper |Repository |Features |
|
||||
|----------------------------------|-------------------------------------------------------------------------------------------|---------------------------|
|
||||
|.Net Standard |[mtrdp642/PokeApiNet](https://github.com/mtrdp642/PokeApiNet) |Auto caching |
|
||||
|Dart |[prathanbomb/pokedart](https://github.com/prathanbomb/pokedart) | |
|
||||
|Go |[mtslzr/pokeapi-go](https://github.com/mtslzr/pokeapi-go) |Auto caching |
|
||||
|PHP |[lmerotta/phpokeapi](https://github.com/lmerotta/phpokeapi) |Auto caching, lazy loading |
|
||||
|PowerShell |[Celerium/PokeAPI-PowerShellWrapper](https://github.com/Celerium/PokeAPI-PowerShellWrapper)| |
|
||||
|Python |[beastmatser/aiopokeapi](https://github.com/beastmatser/aiopokeapi) |Auto caching, asynchronous |
|
||||
|Ruby |[rdavid1099/poke-api-v2](https://github.com/rdavid1099/poke-api-v2) | |
|
||||
|Rust |[lunik1/pokerust](https://gitlab.com/lunik1/pokerust) |Auto caching |
|
||||
|Scala |[juliano/pokeapi-scala](https://github.com/juliano/pokeapi-scala) |Auto caching |
|
||||
|Spring Boot |[dlfigueira/spring-pokeapi](https://github.com/dlfigueira/spring-pokeapi) |Auto caching |
|
||||
|Swift |[kinkofer/PokemonAPI](https://github.com/kinkofer/PokemonAPI) | |
|
||||
|Typescript server-side/client-side|[Gabb-c/Pokenode-ts](https://github.com/Gabb-c/pokenode-ts) |Auto caching |
|
||||
|Wrapper|Repository|Features|
|
||||
|---|---|---|
|
||||
|.Net Standard |[mtrdp642/PokeApiNet](https://github.com/mtrdp642/PokeApiNet)|Auto caching |
|
||||
|Dart|[prathanbomb/pokedart](https://github.com/prathanbomb/pokedart)| |
|
||||
|Go|[mtslzr/pokeapi-go](https://github.com/mtslzr/pokeapi-go)|Auto caching |
|
||||
|PHP |[lmerotta/phpokeapi](https://github.com/lmerotta/phpokeapi)|Auto caching, lazy loading |
|
||||
|PowerShell|[Celerium/PokeAPI-PowerShellWrapper](https://github.com/Celerium/PokeAPI-PowerShellWrapper)| |
|
||||
|Python|[beastmatser/aiopokeapi](https://github.com/beastmatser/aiopokeapi)|Auto caching, asynchronous |
|
||||
|Ruby|[rdavid1099/poke-api-v2](https://github.com/rdavid1099/poke-api-v2)| |
|
||||
|Rust|[lunik1/pokerust](https://gitlab.com/lunik1/pokerust)|Auto caching |
|
||||
|Scala |[juliano/pokeapi-scala](https://github.com/juliano/pokeapi-scala)|Auto caching |
|
||||
|Spring Boot |[dlfigueira/spring-pokeapi](https://github.com/dlfigueira/spring-pokeapi)|Auto caching |
|
||||
|Swift |[kinkofer/PokemonAPI](https://github.com/kinkofer/PokemonAPI)| |
|
||||
|Typescript server-side/client-side|[Gabb-c/Pokenode-ts](https://github.com/Gabb-c/pokenode-ts)|Auto caching |
|
||||
|
||||
## Donations
|
||||
|
||||
Help to keep PokéAPI running! If you're using PokéAPI as a teaching resource or for a project, consider sending us a $10 donation to help keep the service up. We get 330 million requests a month!
|
||||
Help to keep PokéAPI running! If you're using PokéAPI as a teaching resource or for a project, consider sending us a donation to help keep the service up. We get 1+ billion requests a month!
|
||||
|
||||
Thank you to all our backers! [Become a backer](https://opencollective.com/pokeapi#backer)
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ The container connects to a Redis cache via the environment variable `REDIS_CONN
|
|||
|
||||
### Run the container
|
||||
|
||||
The container exposes port `80`. It needs a PostgreSQL and a Redis instance to connect to. Refer to the section [How to use this image](./how-to-use-this-image) for mapping the environment variables.
|
||||
The container exposes port `80`. It needs a PostgreSQL and a Redis instance to connect to. Refer to the section [How to use this image](#how-to-use-this-image) for mapping the environment variables.
|
||||
|
||||
It's recommended to use the provided [docker-compose.yml](https://github.com/PokeAPI/pokeapi/blob/master/docker-compose.yml) to start a container from this image.
|
||||
|
||||
|
|
|
@ -6,4 +6,4 @@ services:
|
|||
context: .
|
||||
dockerfile: ./Resources/docker/app/Dockerfile
|
||||
|
||||
# docker-compose -f docker-compose.yml -f docker-compose-dev.yml up -d
|
||||
# docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d
|
||||
|
|
Loading…
Reference in a new issue