it’s my first time deploying an Angular application on DigitalOcean app platform (I develop React application usually). The problem I am experiencing here is the failure of application’s health checks during the deployment phase. I read the DigitalOcean’s documentation about health checks but still i can’t figure out what’s the problem.
These are my App Spec file and the screenshots of the DO log console.
alerts:
- rule: DEPLOYMENT_FAILED
- rule: DOMAIN_FAILED
envs:
- key: NODE_OPTIONS
scope: RUN_AND_BUILD_TIME
value: max-old-space-size=4096
- key: GENERATE_SOURCEMAP
scope: RUN_AND_BUILD_TIME
value: "false"
ingress:
rules:
- component:
name: ------------
match:
path:
prefix: /
name: seahorse-app
region: fra
services:
- build_command: npm run build
environment_slug: node-js
github:
branch: master
deploy_on_push: true
repo: -----------------
health_check:
http_path: /
http_port: 4200
instance_count: 1
instance_size_slug: professional-s
name: ------------
run_command: npm start
source_dir: /
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi there,
The
npm run
starts a development server which is not really needed when deploying to production. What you could do instead is to deploy your Angular app as a static site rather than a web service.You can follow the steps here on how to do that:
https://docs.digitalocean.com/products/app-platform/how-to/manage-static-sites/
Here is an example App Spec YAML file that should also work:
If you prefer to use a web service rather than a static site, what you could do is set up a demo repository and share a link to it here so I could try to deploy it and further debug the health check problem.
Let me know how it goes1
Best,
Bobby