Dockerfile And Filing a Bug Report to Quasar for V4V.app v2

in Value 4 Value11 months ago

Building the next v4v.app v2

This is a value for value post: see the explanation in the footer.


Quasar from @ausbitbank Discord AI

Dockerfile

The first thing I did today was add a Dockerfile to the project. I copied this from the one I've been using with v4v.app.

You can see the Dockerfile here:

https://github.com/brianoflondon/v4vapp-frontend-v2/blob/feature/add-dockerfile/Dockerfile

ChatGPT provides the following explanation of the Dockerfile:

This is a Dockerfile, a file used to define a Docker image that can be used to run an application or service in a containerized environment. The Dockerfile consists of instructions that specify the steps to create the Docker image.

This particular Dockerfile has two stages. The first stage uses the Node.js version 16 base image to build a Quasar project. The steps in this stage involve setting the working directory to /app, copying the package.json and yarn.lock files, installing the dependencies using yarn, copying the rest of the application code, and building the Quasar app for production using the quasar build command.

The second stage uses the Nginx stable version base image to serve the built project. The steps in this stage involve copying the built project from the previous stage, copying the Nginx configuration file, exposing the default Nginx port (port 80), and running the Nginx server using the CMD instruction.

Overall, this Dockerfile builds a Docker image that can be used to run a Quasar app in a production environment using Nginx as the web server. The first stage builds the app, and the second stage serves it using Nginx.

I also had to add an nginx.conf configuration for Nginx (the web server software used within the Docker image).

Upgrading Quasar

I tried to upgrade to the very latest version of Quasar. However that caused the Docker build (which was working) to fail. With a bit of help I tracked down the problem to this line:

# Build the Quasar app for production
RUN npx quasar build

This shouldn't be a problem, but something in the upgrade caused a breakage so I have reported that on the Quasar github page.

I figured out that the following change does make it work again but I know that npx is the preferred way to run this within Docker.

RUN yarn global add @quasar/cli
RUN quasar build

Solution

As I was writing this post, my issue on Github was answered. This wasn't a problem with Quasar, the fault is mine (sort of). The problem is in my file giving all the dependencies for the project which has two conflicting lines.

Your project seems to be a q/app-vite one, but you have both q/app-vite and q/app-webpack specified in your package.json.

Remove q/app-webpack. Also, for future reference, q/app-* should never be in "dependencies" but in "devDependencies".

Following this information I ran yarn remove @quasar/app-webpack and reverted the Dockerfile back to the one with RUN npx quasar build and everything works.

There's still a question for the Quasar people as to why @quasar/app-webpack got into my project, I don't think I manually installed it but I've got to say package management in Javascript is a convoluted mess so perhaps I did something which had that consequence.

What did we learn?

ChatGPT is excellent... but finding real experts is priceless and thinking I had found a bug in Quasar (whilst I was wrong) led me to ask for help in exactly the right place.

Nobody knows all this stuff. Many people know a lot more than I do but part of the skill here is knowing where to find the answers to anything that's bothering you.

It's all on Github

You can see all the steps in this branch: https://github.com/brianoflondon/v4vapp-frontend-v2/tree/feature/add-dockerfile

Adding Docker


Value for Value

For the last few months while building @v4vapp I was generously supported by the DHF. Going forward I have a much more modest support which covers direct server costs and a little of my time.

If you appreciate the work I do on and around Hive, you can express this directly: upvoting posts on Hive is great. Also consider a direct donation (there's a Tip button on Hive or a Lightning Address) on all my posts.

Support Proposal 244 on PeakD
Support Proposal 244 with Hivesigner
Support Proposal 244 on Ecency
Vote for Brianoflondon's Witness KeyChain or HiveSigner


Send Lightning to Me!

Sort:  

Today I heard the news about ChatGPT rival Google's Bard launched in 180 countries. That seems a really great move and Google always wanna take the advantage of it.

Just tried it. Flat out refused to refactor some Vue javascript. It's useless for me.

Did u report the issue or bug to the Google?

I ain't got time to help Google, I'm too busy suing them!

Oops. But they are still in early phase and love to hear feedback about their product from the like minded like you.

When they pay me, I'll work for them.

Yes they give rewards to them who finds bugs in their projects.

I 100 % agreed with you, ChatGPT is no doubt an awesome advancement to the technology but yes there are flaws that can only be judged by real humans and experts in the specific field. Some people are saying Software like ChatGPT will replace humans, but here my view is different, nothing could replace humans, yes, there is no doubt Chatgpt and AI is providing a real help to humans.

Congratulations @brianoflondon! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You received more than 75000 upvotes.
Your next target is to reach 80000 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out our last posts:

The Hive Gamification Proposal

Docker containers are a normality with any new modern application and great information on how to use that. Nice to see how you use ChatGPT to make your work easier and I used it in the same way at work for automation tests.

With so much different perspective about chatgpt. Some claiming it is not here to stay, some claiming it is certainly here to stay but so far with the features and benefit it is bringing to our world and helping to ease the complexity of works or task, I am seeing it been around for years. In fact I am a big fan of it.

I am imagining the work you must have extra done sorting out the dockerfile assuming chatgpt is not around to be used.

Although there are some bugs in the system, ChatGPT is a great initiative and hopefully it will help people a lot.