Update dev instructions

This commit is contained in:
Alexandre Aubin 2023-07-29 19:32:16 +02:00
parent 944a27037b
commit 136ad443f5

View file

@ -9,16 +9,19 @@
- and then `apt update && apt install docker-ce` - and then `apt update && apt install docker-ce`
- Install Docker-compose - Install Docker-compose
- `pip3 install docker-compose` - `pip3 install docker-compose`
- Inside your Yunohost LXC/ynh-dev/???, make sure the new `yunohost-portal-api` is running and corresponding route is in nginx config - Inside your Yunohost LXC/ynh-dev/???, make sure the new `yunohost-portal-api` service is running and corresponding route is in nginx config
- Add something like `NUXT_PUBLIC_API_IP=yolo.test` inside a `.env` which you may need to create. Replace `yolo.test` with you test domain or test IP (eg your ynh-dev LXC) - **Important**: Inside your Yunohost machine, enable CORS from your dev front-end:
- `echo "http://127.0.0.1:3000" > /etc/yunohost/.portal-api-allowed-cors-origins`
- `systemctl restart yunohost-portal-api`
- Back to Yunohost-portal's repo: define what's the IP / domain of your test LXC where the API lives (here, for example, `yolo.test` which is define in `/etc/hosts`):
- `echo 'NUXT_PUBLIC_API_IP=yolo.test' > .env`
- `docker-compose up -d` : will rebuild the docker on the first time, then launch it - `docker-compose up -d` : will rebuild the docker on the first time, then launch it
- Check `docker-compose logs -f` : should show that nuxt/nitro is building stuff then serving it on port 3000 - Check `docker-compose logs -f` : should show that nuxt/nitro is building stuff then serving it on port 3000
- Access `127.0.0.1:3000` from your browser - Access `http://127.0.0.1:3000` from your browser
### Develop (manual / directly on your host machine) ### Develop (manual / directly on your host machine)
- Same as for Docker, this assumes that `yunohost-portal-api` does run, is configured in nginx, and you may have to set `NUXT_PUBLIC_API_IP` in `.env` which you may have to create - Basically the same stuff, but ignore docker-related steps. Instead:
- You'll need NodeJS 18.14 (or higher) - You'll need NodeJS 18.14 (or higher) and `yarn`
- And `yarn`
- Run `yarn install` - Run `yarn install`
- Run `yarn dev` - Run `yarn dev`