Docker Compose is created with redis , worker , postgis database , api and frontend all in one making it easy for development . For production it is not recommended
-
Clone Repo
git clone https://github.com/hotosm/fAIr.git
-
Get Docker Compose Installed
If docker is not installed , Install it from here
docker compose version
-
Check your Graphics (Optional)
fAIr works best with graphics card , Ideally you can also set it up only with CPU though for the development , but if you want models to be trained locally GPU is recommended. Nvidia Graphics cards are tested
You need to make sure you can see your graphics card details and can be accessed through docker by installing necessary drivers
By following command you can see your graphics and graphics driver details & nvidia container toolkit is installed More details here
nvidia-smi
-
Setup
bash ./manage-dev.sh setup
It will create .env.dev in your dir , Now replace your credentials for the Login
-
Register your Local setup to OSM
- Go to OpenStreetMap , Login/Create Account
- Click on your Profile and Hit
My Settings - Navigate to
Oauth2 Applications - Register new application
- Check permissions for
Read user preferencesand Redirect URI to behttp://127.0.0.1:3000/authenticate/, Give it name asfAIr Dev Local - You will get
OSM_CLIENT_ID,OSM_CLIENT_SECRETCopy them & Replace it back to the .env.dev
-
Build & Run containers
bash ./manage-dev.sh start
Frontend will be available on 5000 port , Backend will be on 8000 , Flower will be on 5500
Please open the frontend using URL
127.0.0.1:3000instead oflocalhost:3000to ensure login functionality. -
Want to run your local tiles ?
You can use titler , gdals2tiles or nginx to run your own TMS server and add following to docker compose in order to access your localhost through docker containers . Add those to API and Worker . Make sure you update the .env variable accordingly