Does Qovery support nodejs app as stateful server with some working folders?

Issues information
OS: Win2000x64
databases: SQlite3
Programming language and version: nodejs app with node-v12
Link to your project on Github/Gitlab: GitHub - gordon518/estoreLite

Your issue
I just retreated from Heroku and Vercel, they can’t support my nodejs app because they only can host serverless and stateless functions, not for real nodejs app.

My nodejs app is a real nodejs app which is stateful and has some working folders for my codes to write. Does Qovery support nodejs app as stateful server with some working folders?

After deploying my app to Qovery at idate/idate/idate from GitHub - gordon518/estoreLite , the Qovery shows error message as following:
Error: listen EACCES: permission denied 0.0.0.0:80

The error message is similar as Heroku and Vercel. So I want to ask the question. Does Qovery support nodejs app as stateful server with some working folders for my codes to write? Thanks.

Dockerfile content (if any)
Qovery at idate/idate/idate

Qovery indeed can host your node.js app, but you will need to create a Dockerfile for running app on qovery, and you will need to open a port in settings if used any, and in actions memu click on open to view your web app

Can you share your complete app logs when it fails?

After reading the document for Dockerfile, i don’t think the build mode of Dockerfile can fit my nodejs app because there are many code folders contain js files, ejs files, htm files and css files besides the WORKDIR. Actually what i want the deployment to do is to clone everything from “GitHub - gordon518/estoreLite” to my deployment folder. Can Qovery provide such option?

My nodejs app is pretty common. It only need 3 steps to run.

  1. Clone the git repository at " GitHub - gordon518/estoreLite" to your server’s deployment folder.
  2. Run the command “npm intall” to install node modules.
  3. Run the command “node ./” or “npm start” to run the app.

Can Qovery provide the clone option for build mode? Thanks.

Thats what Dockerfile is, it will copy all files in your repo to Qovery, and create a dir and set it to working dir and copy the package*.json to that folder and install node module using npm install
And copy all the project files to working dir with COPY . . command and finally run the project with CMD [“npm”, “start”]

You can watch the video on how to write dockerfile for node express app

You will need to use EXPOSE 3000
Or any port before CMD command for express project

Yes, Dockerfile works. Now my nodejs app can work on Qovery at https://z38299cb3-gtw.qovery.io. Thanks.

The following is my Dockerfile:
-----Dockerfile start------
FROM node:12
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY . .
RUN npm install
EXPOSE 3000
CMD node ./
-----Dockerfile end------

What’s the meaning of “EXPOSE 3000” in Dockerfile?
Can I download files from my WORKDIR? If yes, what tool to download? FTP? Thanks.

Expose 3000 opens the port that your app will work on🙂

1 Like

Hey @gordon518, is your app listening for HTTP requests on some port? If so, you can use EXPOSE XXXX to indicate which port the app uses for example to respond to HTTP requests.

Expose 3000 opens the port that your app will work on🙂

Kartik you’re too fast :slight_smile:

1 Like

Can I download files from my WORKDIR? If yes, what tool to download? FTP? Thanks.

@gordon518 could you describe more precisely what you want to achieve? You could use your nodejs app to serve files from some folder to make it easier to download.

I plan to let user upload jpg files to a folder, and my codes use SQlite to store user profile data. So i want to download these files periodically for backup. I see “https://www.namecheap.com/hosting/shared/” can provide FTP and SSH. Can you provide that? Thanks.

you can use nodejs modules to store data inside the sqlite database in the form of buffer data and return the processed buffer data back to image to user when requested

Qovery does not work like that. You can attach storage to your app and store images inside them and return url of the image or store it in database using buffer data conversion

I know what you mean, but i think it’s not convenient comparing to FTP. Furthermore i want to change js code, or ejs file by FTP. By FTP, user can only change one source code file in the nodejs project without re-deployment entire nodejs project. So the functionality of file manager is essential. There is replacement of FTP, you provide control panel for hosting space, and put file manager in the control panel. Thanks.