Setting up YantrashalaCMS in your machine

Clone the repository

git clone git@github.com:yantrashalait/CMS.git

Setup Docker

Install docker in your local machine.

Build the docker containers

Copy .sample.env and create a file dev.env in the same path.

First, you need to setup the containers in your machine. Go to directory that you have cloned from GitHub.

docker-compose -f docker-compose.yml up --build

Now you can see containers built by using the following command:

docker ps

It shall list some containers like django4cms, db4cms, yantrashalacms_redis_1, etc. These are the containers name.

Start the containers

Next time you need to start the container, you can do it with the following command:

docker-compose -f docker-compose.yml up -d

To view the logs directly in your screen, use

docker-compose -f docker-compose.yml up

Stop the containers

After you have finished performing your tasks for the day, it is a good practice to stop the containers. For that you can use:

docker-compose -f docker-compose.yml down

Restart a container

For example: to reflect any changes in django4cms container, you don't need to stop the whole containers. Instead use

docker restart <container_id>

To go inside the shell of any container

docker exec -it <container_name_or_id> bash

To execute any command inside a container

docker exec -it <container_name_or_id> <command>

e.g.
docker exec -it django4cms python manage.py migrate
docker exec -it django4cms python manage.py makemigrations