Develop a Dockerized Python simple social network.
- WSL (For non-unix users)
- Docker
- Open your terminal in your home directory (Optional location).
- Create a
src
directory to contain the project- mkdir src && cd src
- clone the repository
- Run
source scripts.sh
. - Stay in the same terminal to be able to access docker shell commands.
- Make sure your docker is installed and the daemon is running
- By running:
docker ps
- By running:
- Set environment variables in your ~/.profile or ~/.bash_profile:
Example:
export CT_DIR="{the absolute path to the repo}"
/home/user/src/crocosoft-task
- Open new terminal to load the new variable
- Load docker shell commands
- Go to the project root directory and run
source scripts.sh
- Or you can add
source ${CT_DIR}/scripts.sh
to your ~/.bash to have the commands always available.
- Go to the project root directory and run
Once shell commands are loaded, you can now use them to set and run the project in this order:
- create
.env
file by runningcp sample.env .env
and fill it with you credintials. ct-build
: to build docker container from image.ct-up
: to run the containerct-run
: to run flask serverct-down
: Once you are done with the container you can use this command to take it down (recommended to save your computer resources).
NOTE: If you run ct-run, it will automatically build and start up the container. NOTE: After runing the container for the first time, give it a fex seconds before making requests just to make sure all services are up.