Live Docker NocoDB Django Postgres Project:


1. Docker Management

General overview and run commands (repo/README.md)

Public demo

Only accessible from NGINX_ALLOW_EXTERNAL_IP_RANGE (per Github secrets: school network or VPN)

Production PowerPC (ppc64le) server:

Local development setup

Recommendation


First time setup

  1. Clone repo: git clone https://github.com/fiitka/SmartRent.git
  2. cd SmartRent
  3. Force Windows Git to not be CRLF but LF for Docker Shell Scripts to work: echo "core.autocrlf=false" >> .git/config ; git rm --cached -r . ; git reset --hard
  4. Go to a branch where you will develop: git checkout -b dev-<your-github-username>
  5. Set environment variables for all Docker services: cp .env.example .env + FILL IN THE BLANK VARIABLES WITH RANDOM VALUES
  6. Just in case: Stop and remove all remaining Docker containers and networks prefixed with "launchrentals-": docker stop $(docker ps -a -q -f name=launchrentals-) ; docker rm -f $(docker ps -a -q -f name=launchrentals-) ; docker network rm $(docker network ls -q -f name=launchrentals_)
  7. Start the service chain: docker compose --profile dev up -d in the root directory (-d for detached mode)
  8. Wait for nginx service to be up and running (last in chain)
  9. If working on frontend, make sure to docker exec -it launchrentals-company_admin_frontend-1 /bin/bash or docker exec -it launchrentals-presentation_frontend-1 /bin/bash into your frontend instance and run npm run build-ci-prod manually to generate build files, this is manual as it can take up to 15 minutes and applies to both frontends (presentation and company)

Often used: Restart after minor config changes, inconsistencies or computer reboot:

Here it is in one line (you will be copy-pasting this a lot, recommended to add to .bashrc as an alias):

docker compose down ; docker stop $(docker ps -a -q -f name=launchrentals-) ; docker rm -f $(docker ps -a -q -f name=launchrentals-) ; docker network rm $(docker network ls -q -f name=launchrentals_) ; docker compose --profile dev up -d

Also often used: Rebuild after major changes (especially if package.json changed on frontend!):

Here it is in one line (you will be copy-pasting this a lot, recommended to add to .bashrc as an alias):

docker compose down ; docker stop $(docker ps -a -q -f name=launchrentals-) ; docker rm -f $(docker ps -a -q -f name=launchrentals-) ; docker network rm $(docker network ls -q -f name=launchrentals_) ; docker compose build --no-cache ; docker compose --profile dev up -d

Also useful if you're only changing nginx configuration (nginx.template.conf) locally may be this selective restart:

docker compose -p launchrentals stop nginx_reverse_proxy && docker compose -p launchrentals build nginx_reverse_proxy && docker compose -p launchrentals build nginx-dev-reconfig && docker compose -p launchrentals up -d nginx-dev-reconfig && docker compose -p launchrentals up -d nginx_reverse_proxy

If broken: Purge all containers and images (WARNING: this will remove !!!ALL!!! containers on your machine):

For debugging:

Service versions and usage

These are the versions Docker Compose uses:

If you won't use Docker, you need to (seriously, JUST USE DOCKER!!! or it will be painful...):


What you should know

Folder structure