This application provides following functionalities:
- Search players with given word that is found in name, nationality or club
- Build a team with given budget
- Python 3.8+
- Remote MySQL server
- Docker
CONTAINER_NAME can be determined using docker ps.
- Create .env file from .env-sample using your remote sql credentials.
- Run following command to build Docker image.
docker build -t fifa_helper:latest .
- Run following command to start server.
docker run --env-file=.env -p 8000:8000 fifa_helper
- Run following command to initialize db and create first players.
docker exec -it $CONTAINER_NAME python player_creator.py
CONTAINER_NAME can be determined using docker ps.
- Use following command for coverage.
docker exec -it $CONTAINER_NAME coverage run -m pytest
- Use following command to see report.
docker exec -it $CONTAINER_NAME coverage report
- Get a Heroku account.
- Login to your account using the command below.
heroku login
- Login to container service.
heroku container:login
- Create a new space for your application with following:
heroku create
- Build and push the docker image using command below.
heroku container:push web
- Release the application using command below.
heroku container:release web
- Set environment variables using following command:
heroku config:set $(cat .env | sed '/^$/d; /#[[:print:]]*$/d')
- Start the application using the command below.
heroku ps:scale web=1
You can test the application using this url.