Closed ImShallo closed 7 months ago
my bad I forgot to add /*
after the dist folder, this should work:
FROM node:20.11.1-buster
WORKDIR /
RUN git clone https://github.com/Ilyas-Codes/eCourse.git
ARG PB_VERSION=0.21.3
ADD https://github.com/pocketbase/pocketbase/releases/download/v${PB_VERSION}/pocketbase_${PB_VERSION}_linux_amd64.zip /tmp/pb.zip
RUN unzip /tmp/pb.zip -d /eCourse/pb
WORKDIR /eCourse/ui
RUN sed -i 's/^VITE_PROD_PB_URL=.*/VITE_PROD_PB_URL=http:\/\/127.0.0.1:8090/' .env
RUN npm install
RUN npm run build
RUN mv dist/* /eCourse/pb/pb_public
EXPOSE 8090
CMD ["/eCourse/pb/pocketbase", "serve", "--http=0.0.0.0:8090"]
my bad I forgot to add
/*
after the dist folder, this should work: ....
Still not working @Ilyas-Codes, idk what I am doing wrong but I tried also with docker-compose (to just use the dockerfile because there is no image of ecourse on the docker hub)
Here's the only log of the container
2024/02/28 21:26:09 Server started at http://0.0.0.0:8090
├─ REST API: http://0.0.0.0:8090/api/
└─ Admin UI: http://0.0.0.0:8090/_/
Essentially only pocketbase started (and it works)
Moreover... I've tried to run the app on my windows machine and it works perfectly
C:\Users\Administrator\Desktop\eCourse\ui>npm run dev
> ecourse@2.0.0 dev
> vite
VITE v5.1.4 ready in 1061 ms
➜ Local: http://localhost:5173/
Shouldn't the dockerfile do the same? I'm not an expert of Docker, but I think that this app should have two images: one of the backend (pocketbase) and another one for the ui (vite). Maybe you can achieve this better with docker-compose
weird, I just tested it and it worked fine. can you redo everything from scratch? delete the container and image and redo the build again.
@Orohym here are the steps I followed with docker:
Dockerfile
I left in my first comment in there.docker build -t image-name .
docker run -d -p 8090:8090 --name container-name image-name
localhost:8090
@Ilyas-Codes I replicated your steps and it works.
I was still copying the Dockerfile example from the Readme file and that was the reason it was not working. (😅)
Thank you
Not a problem :)
Description
Users experience a PocketBase 404 (Not Found) error when accessing the frontend via the designated IP address, despite the backend working properly.
Steps to Reproduce
Expected Behavior
Users should be able to access the frontend interface without encountering a 404 error.
Frontend View Backend View