Note: the project can work both on main and preview branch, but the special branch preview contains the right route to have a preview in sync with Directus. The main branch does not contain preview route because it breaks the static building export.
First, we need to have next.ftso.local redirects to 127.0.0.1.
- on OSX in /private/etc/hosts
- on Linux in /etc/hosts
- on Windows in C:\Windows\System32\drivers\etc\hosts
Adding at the end of file
127.0.0.1 next.ftso.local
127.0.0.1 directus.ftso.localPlease do not forget to create .env with current envs:
NODE_ENV=development
NEXT_PUBLIC_BASE_URL=https://next.ftso.local
DIRECTUS_URL=https://directus.ftso.local
NEXT_PUBLIC_DIRECTUS_URL=https://directus.ftso.localYou should change DIRECTUS_URL and NEXT_PUBLIC_DIRECTUS_URL with current production URL of our directus. While if you like to experiment with directus in development just leave as it is the DIRECTUS url to local directus url (https://directus.ftso.local)
Using mkcert for local development:
cd /certs
mkcert -install
mkcert next.ftso.local directus.ftso.localBefore running the project switch from the branch main to preview
Just run to build:
docker-compose buildJust run to work:
docker-compose upAt the end you should able to go https://directus.ftso.local and https://next.ftso.local. Please note: Current directus live container is ready to work with https://next.ftso.local