Installation guide¶
Development with Docker (Windows)¶
- Install WSL2 and set it as default WSL version. Download from here.
wsl --set-default-version 2
-
Enable Hardware virtualization in BIOS. Follow this link.
-
Install Docker Desktop. Download from here.
-
Run
./localServer.ps1script to build and run images. The localServer.ps1 script takes care of the migrations and has a cleanup function, clearing old images from cache, if you do not want to clear, run the following:
docker compose -f docker-compose-dev.yml build
docker compose -f docker-compose-dev.yml run --rm web python /dokuly_image/dokuly/manage.py makemigrations
docker compose -f docker-compose-dev.yml run --rm web python /dokuly_image/dokuly/manage.py migrate
docker compose -f docker-compose-dev.yml up
localServer.ps1 builds both Django and PostgreSQL services
- Run
bun run devto start the frontend development server. If Bun is not installed, install it from https://bun.sh (or runcurl -fsSL https://bun.sh/install | bashon Linux/macOS).
Local Django development server should run on localhost:8000
Both db (postgres / psql) and Django are accessible through CLI in the docker desktop
Development with Docker (Mac)¶
When developing with Apple silicon (M1), a special Docker version must be installed.
Find the correct package here.
Development (Linux)¶
If working on Debian Linux. Run the script debain_install_dependencies, to install the necessary dependencies to run the dokuly Docker.
Build Django and PostgreSQL services¶
- Confirm Docker Compose-version and download Docker Compose for Linux.
mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
- Restart the machine.
sudo systemctl reboot
- Set permission so that Docker Compose is executable.
chmod +x ~/.docker/cli-plugins/docker-compose
sudo chown $USER /var/run/docker.sock
- Verify the installation.
docker compose version
# output should be similar to this:
Docker Compose version v.2.2.3
- Run and build containers from root of dokuly project.
docker compose -f docker-compose-dev.yml build
docker compose -f docker-compose-dev.yml run -u root web python /dokuly_image/dokuly/manage.py makemigrations
docker compose -f docker-compose-dev.yml run -u root web python /dokuly_image/dokuly/manage.py migrate
docker compose -f docker-compose-dev.yml up
On Mac:
```bash
docker compose -f docker-compose-dev-mac.yml build
docker compose -f docker-compose-dev-mac.yml run -u root web python /dokuly_image/dokuly/manage.py makemigrations
docker compose -f docker-compose-dev-mac.yml run -u root web python /dokuly_image/dokuly/manage.py migrate
docker compose -f docker-compose-dev-mac.yml up
If you enconter the error:bash
Status: cgroups: cgroup mountpoint does not exist: unknown, Code: 1
```
Run the following workaround:
sudo mkdir /sys/fs/cgroup/systemd
sudo mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd
This will build both Django and PostgreSQL, as they are built together in the same docker-compose file.