Note: Make sure you're in the python subdirectory while executing these commands.
- Create a virtual environment
python -m venv env
and activate using
# for macos
source env/bin/activate
# for windows
.\env\Scripts\activate
- Install required packages
pip install -r requirements.txt
- Open the terminal and run the sanic server
python src/app.py
You should see the following message in the terminal
Goin' Fast @ http://0.0.0.0:8001
-
Open your browser and enter
http://0.0.0.0:8001/hi
in the website section. You should get{"value":"hello"}
as the response.In case, the response isn't visible, try
http://localhost:8001/hi
. You should see the above response here.
Now head to sandbox and try the api checkpoints. Happy coding ( •̀ .̫ •́ )✧
-
Download the Docker GUI here.
-
Open the terminal and run the following command to build a docker image
docker build -t <TAG> .
# for m1 mac
docker build --platform x86_64 -t <TAG> .
once executed, the docker image is visible with
docker images
- To export your docker image for submission, run
Note: Make sure gzip is intalled before proceeding.
docker save <TAG> | gzip > <TAG>.tar.gz
- To run the built container locally, run
docker run -p 8001:8001 -m=2048m --cpus=1 -it <TAG or IMAGE ID>
docker rmi <IMAGE ID>