DigitalOcean launches App Platform

@George - i’m not sure if this is valuable here in this post, or if it should be unlisted/moved to bugs. Purpose of this post is to help if you are moving forward with some point with DO deployment for their new app platform.

I’ve just created and deployed to a new gitlab repo, then I’ve gone through the process of binding and deploying to the new DO platform. I get these two errors, making deployment fail:

Deploy Error: Non-Zero Exit Code

Your deploy failed because your container exited with a non-zero exit code.
Error code: DeployContainerExitNonZero

Deploy Error: Non-Zero Exit Code

Common Causes

  • Missing dependencies, incompatible versions, incorrect environment variables or app bugs

Component Issues

  • MYAPPNAME - failed to deploy

Deploy Logs:
[2021-04-18T22:59:52.458784746Z]
[2021-04-18T22:59:52.458834087Z] > new_contact_search_app@1.0.0 start
[2021-04-18T22:59:52.458840817Z] > ./index.js
[2021-04-18T22:59:52.458846434Z]
[2021-04-18T22:59:52.493535275Z] sh: 1: ./index.js: Permission denied
[2021-04-18T22:59:52.511485285Z] npm notice
[2021-04-18T22:59:52.512184080Z] npm notice New minor version of npm available! 7.7.6 -> 7.10.0
[2021-04-18T22:59:52.512679284Z] npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.10.0
[2021-04-18T22:59:52.513014345Z] npm notice Run npm install -g npm@7.10.0 to update!
[2021-04-18T22:59:52.513508861Z] npm notice

Build Logs:
[2021-04-18T22:57:06.999821949Z] cut: write error: Broken pipe

Other than this, getting setup was pretty easy - and you can also turn OFF automatic deployment, which can help the issue of two repos.

I hit the permission error as well, but for me George’s revised start command fixed that. I think the only other change I had to make was to set my config to port 8080 to match what DO was expecting.

Once configured, it works really well…I just make sure to only deploy to the Master branch when the production target is active.

1 Like

Thank you @mebeingken - I’ll follow this and see if it resolves for me also.

If you don’t mind me asking, purely so I get a better undestanding:

I just make sure to only deploy to the Master branch when the production target is active.

Why do you make sure to do this? Is this because the package.json differs per target, and only in your prod target have you changed the package.json file?

And also if you don’t mind, how have you setup a prod environment without a remote server (and where then do you change the port) considering deployment is actually taken care of by the git push?

@George are we unable to use the local redis we create natively within Wappler with such an implementation? E.g. there are costs associated with using a DO Redis DB.

Sorry to pester @George - just wondering if possible to use the Redis we implement natively in a Docker NodeJS app with Wappler - or for DO Apps, we will need to use an external Redis DB? Just so I know how to proceed today/tomorrow.

With the Digital Ocean Apps you get managed apps.
It is like Heroku basically a Paas, platform as service.

So you are just deploying your NodeJS app and nothing else and don’t have to care about infrastructure and servers.

This can be easier to do and you don’t have to care for servers, but of course comes with extra costs and less freedom.

Any extra services like databases have to be added as Apps addons or external managed services.

So basically digital ocean is creating and managing the servers on the background for you. They actually use also docker internally for that.

If you want more flexibility just use the docker machine manager in Wappler to create your own droplet servers and then deploy self with docker, so you can install more services and not the DO apps platform.

Ok, I had wondered about that.

So, if we use DO Apps - we do NOT use a Wappler Docker Engine, instead for the target we’d just use ‘Own Server’ for instance, and DO Apps service will create the Docker Container? Then to use Redis etc. we use external DBs.

Even with Docker Engine we use external Managed DB’s, but I did like that we were able to use Redis for caching without needing to do so via Wappler.

So if the above target setup is correct, then I understand. Thank you.

Yes correct. Digital ocean manages it for you and you have to use their addons like databases and Redis. You can’t just install your own.

1 Like

Thanks George.

I just tried this wih a default template app (so no database) and I was up and running in 5 minutes. Amazing!! :star_struck:

I’ll report back with how easy or difficult it was to add a managed database to the application.

Thanks for the script edit, @George!

1 Like

So for my quest on how to connect a database I first tried to add a so called ‘dev database’ from the app platform dashboard. This is setup really easily.

However, when I want to connect to the database through Wappler I get this ‘the pool is probably full’ error. So I think that the issue is that my ip-address is not added as a trusted source for this database. I can’t seem to find this option for the dev database, sadly. (I did find it for the managed database, I use this for another project).

So I opened up a ticket with DO to see if this is actually possible or not:

Hi there,

Is it possible to add my own ip-address as a trusted source to a dev database that you can create on the app platform?
I know the app is automatically added, but I want my local dev version of the app to be able to connect to the database in a secure manner.

I do know this is possible with the managed database product. I use this for another project, already. Just wondering if this is possible for the dev databases.

EDIT
it turns out that it is not possible to add your own ip address to the trusted resources on a dev database. So you either have to disable that feature and allow any source to connect to your database (not recommended, but I tried and it does work) or upgrade to a managed database. I will do this tomorrow and get back with the results.

UPDATE:

Upgrading to a managed database was easy as pie. Just walk through some wizard on DO and make sure to add your own ip and the app as trusted sources.
Connecting to the managed database through Wappler gave me a connection timed out error. The fix for me was:

  1. deleting the trusted sources
  2. connecting to the db without those security settings
  3. re-adding the app and my ip as trusted sources
  4. connect to the db without errors this time :grin:

So all in all this app platform seems to be a total win for me. You don’t have to manage your ubuntu setup, you don’t need to fiddle with Traefik for your ssl, you don’t need pm2 or whatever to run different scrips if you like, it’s all done for you! For me this takes away a LOT of the hosting pain and brings Wappler closer to Bubble in terms of N00b friendliness.

Also, I quite like to run Wappler without docker desktop :slight_smile:

Be sure to try this out!

1 Like


During DO Apps > permission denied error appears, any solution pls…

after adding the below script in package.json file it worked, thank you @George bhai :blush:
“scripts”: {
“test”: “nyc mocha”,
“start”: “node ./node_modules/nodemon/bin/nodemon.js ./index.js”
},