accused-moccasinA
Refine3y ago
11 replies
accused-moccasin

how to setup demo line up: a strapi container and a refine app container?

as title say, i am trying on a centos docker env to play this demo:

docker run -it -p 1337:1337 --rm --entrypoint=/bin/bash --name strapi -v /home/book/:/srv/app naskio/strapi


inside the 'strapi' container:
strapi new standardbook --quickstart --no-run
cd standardbook
npm run build 
yarn develop


on the web page 0.0.0.0:1337 we create the strapi full access token like :
dc7ff0d97ee7b1271e4ca94748da5c00ad8d26a77bb873f5fa26be0d1850ddba064ba331388b6e4bd483c2c116795f778726808130530a25f4d9b751b465f20de4c973cc2e23bdaaabb332a2f0c27e02f3536539ec89a0d091fbb831c475e59849a2525c73059079c576385b61db9c3c1ca97e619f72a20f748831c58f7c6935

create the refine container:
docker run -it --link strapi -p 5173:5173 node:18 /bin/bash


inside the 'refine' container:
npm i @refinedev/strapi-v4

npm create refine-app@latest

✔ Downloaded remote source successfully.
✔ Choose a project template · refine-nextjs
✔ What would you like to name your project?: · test
✔ Choose your backend service to connect: · data-provider-strapi-v4
✔ Do you want to use a UI Framework?: · mui
✔ Do you want to add example pages?: · inferencer
✔ Do you need i18n (Internationalization) support?: · i18n-mui
✔ Choose a package manager: · yarn


cd test

yarn dev --host


this is OK for your kindly demo which link to your website. but,
when i try to reconfig the src/constants.ts :
export const API_URL = "http://strapi:1337";
export const TOKEN_KEY = "922d1fa6d8068efa9ecb1fb2d981a82d384561dfab0c2afaaed3900e1ac10171551663c6cd4c888c07e7a2c89bd3cd7b85b123e82d1da7b7c129f71e21e6a52a4c798be85fcf551429675cb471f006b7f202f2fe14b675c92c81b96062750de9aa3e8b3aa930a80a29d30c31118bd1dc3ba36a58e93e2aa9a801712f7c124d71";

//export const API_URL = "https://api.strapi-v4.refine.dev";
//export const TOKEN_KEY = "strapi-jwt-token";


i can not login on the http://localhost:5173/ , the web ui failed by the image attachment.

pls correct me which step i had do the wrong thing, thanks very much !
image.png
Was this page helpful?