Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync/upstream #1

Open
wants to merge 143 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
2892f92
Fixed readme typo
sorinbunnyshell Mar 16, 2023
3379dd4
Merge pull request #17 from bunnyshell/fix-readme-typo
aris-bunnyshell Mar 16, 2023
64a2668
Added template for PyTorch
sorinbunnyshell Mar 27, 2023
fe52a81
Fixed template paths for PyTorch + Enabled debug mode
sorinbunnyshell Mar 27, 2023
946abec
Fixed DEBUG value type
sorinbunnyshell Mar 27, 2023
ac7eb70
Made entrypoint executable for pytorch frontend
sorinbunnyshell Mar 27, 2023
e8d8cbe
Added debug code
sorinbunnyshell Mar 27, 2023
5f02f55
Set workdir for pytorch frontend
sorinbunnyshell Mar 27, 2023
6698f22
Added Template description for PyTorch
sorinbunnyshell Mar 27, 2023
39c3186
PyTorch description improvements
sorinbunnyshell Mar 27, 2023
f527d97
Merge pull request #18 from sorinbunnyshell/ml-hello-world
sorinbunnyshell Mar 27, 2023
9d78424
Merge pull request #19 from bunnyshell/ml-hello-world
sorinbunnyshell Mar 27, 2023
8c586ec
Set versions for PyTorch Hello World app
sorinbunnyshell Mar 27, 2023
e434dc5
Updated repositories
sorinbunnyshell Mar 27, 2023
a0618d2
Merge pull request #20 from bunnyshell/pytorch-versions
sorinbunnyshell Mar 27, 2023
808ebe3
Added Helm Chart + K8s Manifests for demo books (express + react)
sorinbunnyshell May 17, 2023
a2f9931
Added api URL for frontend app in k8s manifest
sorinbunnyshell May 17, 2023
beaa91d
Created template for Express / React / PostgreSQL boilerplate, with H…
sorinbunnyshell May 17, 2023
90dff24
Corrected typo
sorinbunnyshell May 17, 2023
1a15003
Added Helm Chart + K8s Manifests for demo books (express + react)
sorinbunnyshell May 17, 2023
24f269e
Added api URL for frontend app in k8s manifest
sorinbunnyshell May 17, 2023
c36cac0
Merge pull request #22 from sorinbunnyshell/demo-books-helm-components
sorinbunnyshell May 17, 2023
a83a005
Updated reference for components
sorinbunnyshell May 17, 2023
55b962a
Corrected typo
sorinbunnyshell May 17, 2023
6985d37
Merge pull request #23 from sorinbunnyshell/typo-fix
sorinbunnyshell May 17, 2023
a7093d0
Merge branch 'main' into demo-books-helm
sorinbunnyshell May 17, 2023
7f21fe3
Changed repo url + Fixed start/stop path for helm chart
sorinbunnyshell May 17, 2023
b41ca27
Merge pull request #21 from sorinbunnyshell/demo-books-helm
sorinbunnyshell May 17, 2023
799504e
Update version for react app with k8s manifests
sorinbunnyshell May 17, 2023
861cf7b
Merge pull request #24 from bunnyshell/patch-version
mihaichitic May 17, 2023
bef2ad3
fix: mismatch component tag in express-react-postgres-helm-k8s
aris-bunnyshell May 23, 2023
126111a
Merge pull request #26 from bunnyshell/patch-version-1
sorinbunnyshell May 24, 2023
9c5bc9f
- fix `availabe` typo in `book.model.ts`
trapcodeio May 24, 2023
bfae3e1
- change single quote to double quote
trapcodeio May 24, 2023
1a96463
Merge pull request #27 from trapcodeio/fix-book-model-typo
sorinbunnyshell May 29, 2023
d90b493
release: nestjs-rest-api/v0.3.1
aris-bunnyshell May 29, 2023
334adef
Merge pull request #28 from aris-bunnyshell/rel-nra-031
sorinbunnyshell May 29, 2023
52a5063
Updated frontend url to scheme and domain, so preflight requests don'…
sorinbunnyshell Jun 22, 2023
d1f15d0
Merge pull request #33 from bunnyshell/update-hostnames
sorinbunnyshell Jun 22, 2023
9b89f75
feat: add tf-pass-generator component
aris-bunnyshell Jun 23, 2023
4795291
Merge pull request #34 from aris-bunnyshell/tf-pass-generator
aris-bunnyshell Jun 23, 2023
131cb41
Added Terraform RDS module
sorinbunnyshell Jun 29, 2023
866cc6a
Renamed TF module for AWS RDS
sorinbunnyshell Jun 29, 2023
7863805
Added Demo Books with AWS RDS template
sorinbunnyshell Jun 30, 2023
83111bf
Re-ordered vars for api from Demo Books with AWS RDS
sorinbunnyshell Jun 30, 2023
08c0072
Merge pull request #35 from bunnyshell/terraform-rds
sorinbunnyshell Jun 30, 2023
d965660
Fixed wrong template name
sorinbunnyshell Jun 30, 2023
43a9ed1
Merge pull request #36 from bunnyshell/terraform-rds
aris-bunnyshell Jun 30, 2023
123a31c
Renamed database so it complies with RDS naming rules
sorinbunnyshell Jun 30, 2023
62ea281
Merge pull request #37 from bunnyshell/terraform-rds
aris-bunnyshell Jun 30, 2023
4746136
Reference the TF AWS RDS module README absolutely
sorinbunnyshell Jun 30, 2023
adb74b5
Merge pull request #38 from bunnyshell/terraform-rds
aris-bunnyshell Jun 30, 2023
b391439
Addedd S3 Terraform module + Demo Books to use it
sorinbunnyshell Jun 30, 2023
f1da19e
Added copy of express-rest-api application, to be adjusted for images
sorinbunnyshell Jun 30, 2023
37e78c2
Modified Demo Books with images to accommodate images
sorinbunnyshell Jun 30, 2023
e2c36c1
Added copy of react-books-app application, to be adjusted for images
sorinbunnyshell Jun 30, 2023
9716683
Modified Demo Books with images to accommodate images (frontend)
sorinbunnyshell Jun 30, 2023
bfec080
Demo Books FE - changed app path and versions + Fixed bug in state fo…
sorinbunnyshell Jun 30, 2023
7421fb4
Updated IAM permissions needed for the S3 user
sorinbunnyshell Jun 30, 2023
bee834e
Merge pull request #39 from bunnyshell/terraform-s3
sorinbunnyshell Jun 30, 2023
350fb69
Minor change to names to reflect Terraform contents
sorinbunnyshell Jun 30, 2023
95ce022
Merge pull request #40 from bunnyshell/terraform-s3
sorinbunnyshell Jun 30, 2023
0341440
Updated IAM permissions for deleteing S3 bucket
sorinbunnyshell Jul 3, 2023
62f3e26
Reduced IAM permissions to minimum required for TF S3
sorinbunnyshell Jul 3, 2023
2592e0d
Merge pull request #41 from bunnyshell/terraform-s3
sorinbunnyshell Jul 3, 2023
d7d944b
Corrected wrong destroy script for Demo Books Helm
sorinbunnyshell Jul 3, 2023
8618426
Updated template descriptions to be more concise
sorinbunnyshell Jul 3, 2023
24e2fb1
Reverted app name for EAP template
sorinbunnyshell Jul 3, 2023
5d07e31
Merge pull request #42 from bunnyshell/description-improvements
sorinbunnyshell Jul 3, 2023
2f2d40b
Added Magento template
sorinbunnyshell Jul 4, 2023
1747c8f
Magento template updates
sorinbunnyshell Jul 4, 2023
06f2337
Updated Magento Remote Dev command
sorinbunnyshell Jul 4, 2023
3c40fab
Added Sylius templates
sorinbunnyshell Jul 5, 2023
9ca6701
Merge pull request #44 from bunnyshell/sylius
sorinbunnyshell Jul 6, 2023
15647ee
Merge branch 'main' into magento
sorinbunnyshell Jul 6, 2023
4942b5f
Magento Template - separated prod from dev
sorinbunnyshell Jul 6, 2023
571df4b
Updated tag for Magento
sorinbunnyshell Jul 6, 2023
f53a3c7
Sylius - made Remote Development ignore large folders + Mentioned fix…
sorinbunnyshell Jul 6, 2023
ebdc775
Merge pull request #45 from bunnyshell/sylius
sorinbunnyshell Jul 6, 2023
f4381dc
Merge pull request #43 from bunnyshell/magento
sorinbunnyshell Jul 6, 2023
7aa3b64
Removed URL handle for Magento template
sorinbunnyshell Jul 6, 2023
96ad925
Merge pull request #46 from bunnyshell/magento
sorinbunnyshell Jul 6, 2023
902fcb2
Renamed folder reference as well for Magento
sorinbunnyshell Jul 6, 2023
cb3dda6
Merge pull request #47 from bunnyshell/magento
sorinbunnyshell Jul 6, 2023
ba746f9
Renamed folder reference as well for Magento in build context
sorinbunnyshell Jul 6, 2023
d6330b4
Merge pull request #48 from bunnyshell/magento
sorinbunnyshell Jul 6, 2023
50dd135
Added Magento Dev template
sorinbunnyshell Jul 10, 2023
9a0a3c9
Magento dev - added lsof to the image
sorinbunnyshell Jul 10, 2023
57195f4
Added readiness probe for Magento and included it in dev
sorinbunnyshell Jul 10, 2023
ebbd324
Magento Dev - added readiness probe to account for build&deploy time …
sorinbunnyshell Jul 11, 2023
5a50f3a
Magento Dev - simplified readiness probe options
sorinbunnyshell Jul 11, 2023
3f08788
Added support for skipping build & deploy for faster startup in Remot…
sorinbunnyshell Jul 11, 2023
b8aedbc
Magento Dev - entrypoint improvements
sorinbunnyshell Jul 11, 2023
06224d5
Merge pull request #50 from bunnyshell/magento-dev
sorinbunnyshell Jul 11, 2023
964479f
components updated: symfony-rest-api and react-books-app; templates u…
sorinpopescunr2 Jul 26, 2023
b19e49c
components updated: symfony-rest-api and angular-books-app; templates…
sorinpopescunr2 Jul 26, 2023
815869e
updated components: express-rest-api; updated templates: express-angu…
sorinpopescunr2 Jul 27, 2023
fbbb11b
updated templates: express-react-postgres
sorinpopescunr2 Jul 27, 2023
121f0c6
updated templates: express-react-rdspostgres
sorinpopescunr2 Jul 27, 2023
6ece7a2
updated components: react-books-app-images, express-rest-api-images; …
sorinpopescunr2 Jul 27, 2023
c135231
updated components: react-books-app, express-rest-api; updated templa…
sorinpopescunr2 Jul 27, 2023
dda8d55
updated components: nestjs-rest-api; updated templates: nestjs-angula…
sorinpopescunr2 Jul 29, 2023
382208d
updated templates: nestjs-react-mongo
sorinpopescunr2 Jul 29, 2023
10a45f2
updated components: springboot-rest-api; updated template: springboot…
sorinpopescunr2 Jul 29, 2023
70980b4
updated templates: springboot-angular-mysql, springboot-react-mysql
sorinpopescunr2 Jul 29, 2023
841949b
update components: pytorch-hello-world-backend, pytorch-hello-world-f…
sorinpopescunr2 Aug 1, 2023
783c159
updated magento-dev
sorinpopescunr2 Aug 1, 2023
8634533
Merge pull request #51 from sorinpopescunr2/rdev
sorinbunnyshell Sep 12, 2023
e69116d
fix: add the new dependsOn attribute for explicit dependencies
aris-bunnyshell Oct 4, 2023
9d74730
Merge pull request #53 from aris-bunnyshell/fix/add-dependsOn
mihaichitic Oct 11, 2023
1ce79a0
fixes the backend URL for the Angular front end
alexo-bunnyshell Dec 27, 2023
481073d
Merge pull request #54 from bunnyshell/fix-angular-demobooks-url
sorinbunnyshell Jan 10, 2024
4afaa40
Showcase: Template Variables
BunnyCrlu Mar 22, 2024
53c2767
Merge pull request #55 from BunnyCrlu/template-variables
BunnyCrlu Mar 22, 2024
67324b1
Showcase: Template Variables (fix description)
BunnyCrlu Mar 22, 2024
32c7b64
Merge pull request #56 from bunnyshell/template-variables
BunnyCrlu Mar 22, 2024
a7edf49
springboot with gradle and jib component
mihaichitic Mar 19, 2024
affc98e
Merge branch 'bunnyshell:main' into main
mihaichitic Mar 27, 2024
b2d76d3
springboot with gradle and jib template
mihaichitic Mar 27, 2024
e9ea974
Merge pull request #57 from mihaichitic/main
mihaichitic Mar 28, 2024
0f9388f
Update README.md
mihaichitic Mar 28, 2024
5d2b17f
Update bunnyshell.yaml, provide a simpler/ more readable output
aspopescu Apr 1, 2024
caf4644
Merge pull request #58 from aspopescu/patch-1
mihaichitic Apr 3, 2024
b4ceb37
add template categories
mihaichitic Jun 20, 2024
3328d2b
Merge pull request #59 from mihaichitic/main
mihaichitic Jun 21, 2024
1046a0b
change template categories
mihaichitic Jun 21, 2024
9377089
Merge pull request #60 from mihaichitic/template-categories
mihaichitic Jun 21, 2024
6f6a771
update/fix Magento templates
bunnyshell-eaas-migrations Jul 16, 2024
72167f6
Magento Adobe auth as template variables
bunnyshell-eaas-migrations Jul 16, 2024
577b8fd
Merge pull request #62 from alexo-bunnyshell/main
mihaichitic Jul 16, 2024
f2f54f5
implement bns best practices
bunnyshell-eaas-migrations Jul 16, 2024
db29331
Merge pull request #63 from alexo-bunnyshell/main
mihaichitic Jul 16, 2024
c619f82
Added showcase Code Server and Jupyter NoteBook
aminalali8 Jul 23, 2024
25ebeaa
Update showcase-jupyter README.md
mihaichitic Jul 23, 2024
e07cdb2
Merge pull request #64 from bunnyshell/showcase-vsc-jupyter
mihaichitic Jul 23, 2024
dfa6fd8
Update showcase-code-server template.yaml
mihaichitic Jul 23, 2024
42991fc
Update showcase-jupyter template.yaml
mihaichitic Jul 23, 2024
db4d8f4
Merge pull request #65 from bunnyshell/category-fix
mihaichitic Jul 23, 2024
c838e4f
added showcase container patterns
aminalali8 Jul 24, 2024
4af386d
Update template.yaml
aminalali8 Jul 25, 2024
5b14c27
Update template.yaml
aminalali8 Jul 25, 2024
56b65db
Update README.md
aminalali8 Jul 25, 2024
2c5a78a
Merge pull request #66 from bunnyshell/showcase-vsc-jupyter
mihaichitic Jul 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
134 changes: 16 additions & 118 deletions .bunnyshell/templates/express-angular-postgres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,18 @@ This Environment [Template](https://documentation.bunnyshell.com/docs/templates-

The template provides the Bunnyshell configuration composed of 3 Components (frontend + backend + database) and the CRUD application that demonstrates how the components work together to form an environment.

You can extend the template by further adding Components, be them more APIs or other services, such as queues, caches, block storage etc.
An [Environment in Bunnyshell](https://documentation.bunnyshell.com/docs/environments) is a user-defined group that brings together applications and all of the services and databases those applications require.

 

# Environment overview

An [Environment in Bunnyshell](https://documentation.bunnyshell.com/docs/environments) is a user-defined group that brings together applications and all of the services and databases those applications require.

This Environment Template contains 3 components:
- `app` for frontend, based on a `node` image
- `api` for backend, also based on a `node` image
- `db` using a `postgres` image

and 1 persistent volume:
- `data-volume`

## Container images

The images for both frontend and backend have 2 possible stages: `dev` and `prod`.

The `dev` stage is suitable for development, as it contains development packages and libraries and has debugging enabled.
The `prod` stage is meant for production/staging, as it produces an optimizied image, as lightweight as possible.
The `prod` stage is meant for production/staging, as it produces an optimized image, as lightweight as possible.

The stage (`dev` or `prod`) can be set from the Environment's configuration (`bunnyshell.yaml`), within each Component's `dockerCompose.build.target` property. The default is `dev`, and it can be changed to `prod` to produce production-like images.

Expand All @@ -34,19 +24,11 @@ The stage (`dev` or `prod`) can be set from the Environment's configuration (`bu
# How to use this Template

You can create Environments from a [Bunnyshell Template](https://documentation.bunnyshell.com/docs/templates-what-are-templates); these Environments can have multiple purposes:
- Development
- Staging / Dev testing / End-to-end testing

Development Environments should be created with the `dev` target for images (see "Container images") and can be used for Remote Development.

Staging / Testing Environments should be created with the `prod` target for images, in order to have the application running as it does in production.

 

## Staging / Testing

For staging / testing purposes, the Environments just need to be deployed.

You need to ensure that the `dockerCompose.build.target` is set to `prod` for all the Components, and then [deploy the Environment](https://documentation.bunnyshell.com/docs/environment-workflows-deploy).

 
Expand All @@ -55,51 +37,35 @@ You need to ensure that the `dockerCompose.build.target` is set to `prod` for al

[Remote Development](https://documentation.bunnyshell.com/docs/remote-development) allows you to develop directly in a cloud environment, therefore eliminating all inconsistencies and approximations of traditional local environments.

The code is ran in a container running in Kubernetes, and you can choose one of two ways to work, depending whether you prefer to keep a local copy of the code or not.

1. You can have the code existing **only in the container** - you will need an IDE capable of connecting via SSH to install a headless IDE in the container, eg. VS Code or the JetBrains suite.

2. You can have the code existing **on your device** and it will be synchronized into the container - any IDE or plain text editor will do.
The code is executed in a container running in Kubernetes, while being synchronized real-time with your local folders.

📖 For more information on how Remote Development works in Bunnyshell, please see the [dedicated documentation](https://documentation.bunnyshell.com/docs/remote-development).

🧱 Remote Development can only be started from the CLI, so you will need to [install the Bunnyshell CLI](https://documentation.bunnyshell.com/docs/bunnyshell-cli-install) installed and to [authenticate in the CLI](https://documentation.bunnyshell.com/docs/bunnyshell-cli-authentication).

 

### Start a Remote Development session

In order to start a Remote Development session, you must run the dedicated command from the CLI:
```
bns remote-development up
```

The CLI will present a wizard, so you can choose your Environment first, then the Component on which you want to develop on.
You can also pass on the Component ID, to skip the wizard. The full command can be copied from the UI: go to the Environment details screen, click the desired Component, then expand the *Component Actions* and select *Remote Development*.

💡 When typing, you can use the shorter alias: `bns rdev up`

🧱 Please note that starting a Remote Development session requires the *Remote Development* setting to be *ON* for the Environment (*ON* is the default value).

You need to choose the way you wish to work with files, before starting the Remote Development session.
You need to ensure that the `dockerCompose.build.target` is set to `dev` for all the Components, and then [deploy the Environment](https://documentation.bunnyshell.com/docs/environment-workflows-deploy).

 

#### Working with code from your machine
### Start a Remote Development session

When working with code stored locally (the default mode), you just need to run:
In order to start a Remote Development session, you must run a command from the CLI:
```
bns remote-development up
bns remote-development up --component {COMPONENT_ID}
```

The exact command can be copied from the UI: go to the Environment details screen, select the desired Component, then *Remote Development*. In case you do not specify the `component` flag, the CLI will guide you through using a wizard.

You need to provide 2 additional paths:
- the *local path*, for your local code files
- the *remote path*: the path where code files are located within the container (you can find this out from the `Dockerfile`, it's in the `WORKDIR` statement); for the `api` application, it is `/usr/src/app/backend`.

💡 The wizard will require these from you, but you can also provide them as options, `-l` and `-r` respectively.
💡 The wizard will require these from you, but you can also provide them as options, `-l` and `-r` respectively. You can also define [the remote development configuration](https://documentation.bunnyshell.com/docs/remote-development-sharing-configuration) in `bunnyshell.yaml`.

After starting the Remote Development session, the Bunnyshell CLI opens a shell into the container. From it, you can run any application-related command you would run on local.
Please note that **you must start the application** manually, as you may needed to start the application in a number of ways, eg. with or without debugging.
Please note that **you must start the application** manually, as you may need to start the application in a number of ways, eg. with or without debugging.

```
$ bns remote-development up --component {YOUR_COMPONENT_ID}
Expand All @@ -111,53 +77,15 @@ $ bns remote-development up --component {YOUR_COMPONENT_ID}
📖 For more information on starting a remote Development session, please see:
- [How to Start Remote Development](https://documentation.bunnyshell.com/docs/remote-development-start)
- [with local files](https://documentation.bunnyshell.com/docs/remote-development-local-files)

 

#### Working with code from the container

When working directly with the files from the container, you need to disable the synchronization of files, by adding the option `--sync-mode none` to the command. Usually, since you'll be using your IDE to connect to the container, you will also want to pass in `--no-tty`, to disable leaving an SSH terminal into the container, but this is optional and depends on your preferences.

You need to provide the *remote path*: the path where code files are located within the container (you can find this out from the `Dockerfile`, it's in the `WORKDIR` statement); for the `api` application, it is `/usr/src/app/backend`.

💡 The wizard will require this from you, but you can also provide it as an option, using `-r`.

```
bns remote-development up --sync-mode none --no-tty
? Remote Path /usr/src/app/backend
Pod is ready for Remote Development.
You can find the SSH Config file in /Users/myuser/.bunnyshell/remote-dev/ssh-config
```

💡 Remember that you can pass in the optional flag `--component {YOUR_COMPONENT_ID}` to skip running the wizard to choose the Component.

Using the SSH config file, you can now configure your IDE to connect remotely to the container, via SSH.
🚀 [See how to configure VS Code for Remote Development via SSH](https://documentation.bunnyshell.com/docs/remote-development-configure-vs-code-connection)

Please note that using the Terminal from the IDE, **you must start the application** manually, as you may needed to start the application in a number of ways, eg. with or without debugging.

```
/usr/src/app/backend # npm run start:dev
```

📖 For more information on starting a remote Development session, please see:
- [How to Start Remote Development](https://documentation.bunnyshell.com/docs/remote-development-start)
- [with remote files](https://documentation.bunnyshell.com/docs/remote-development-remote-files)

 

### Stop a Remote Development session

In order to stop a Remote Development session, you must run the dedicated command from the CLI:
In order to stop a Remote Development session, you must run the complementary command for `up` from the CLI:
```
bns remote-development down
```

The CLI will present a wizard, so you can choose your Environment first, then the Component for which you want to stop the session for.
You can also pass on the Component ID, to skip the wizard. The full command for starting a session can be copied from the UI: go to the Environment details screen, click the desired Component, then expand the *Component Actions* and select *Remote Development*. Then, you just need to replace `up` with `down.

```
bns remote-development down --component {YOUR_COMPONENT_ID}
bns remote-development down --component {YOUR_COMPONENT_ID}
```

📖 For more information on stopping a remote Development session, please see:
Expand All @@ -173,7 +101,7 @@ The configuration differs based on the way you chose to work, and also on your I

 

#### Debugging backend with code from your machine
#### Debugging backend

When debugging with local code, you need to:
1. start the Remote Development session with port-forwarding on the debugger's port (`9229` for `nodemon`)
Expand All @@ -184,47 +112,17 @@ When debugging with local code, you need to:

For the `api` service, you need to run:
```
$ bns remote-development up --port-forward "9229>9229"
$ bns remote-development up --component {YOUR_COMPONENT_ID} --port-forward "9229>9229"
? Local Path {YOUR_OWN_LOCAL_PATH}}
? Remote Path /usr/src/app/backend
/usr/src/app/backend # npm run start:dev
```
💡 Remember that you can pass in the optional flag `--component {YOUR_COMPONENT_ID}` to skip running the wizard to choose the Component.

You can now add breakpoints and start debugging.

📖 For more information on debugging locally, please see:
- [Debugging locally with port forwarding](https://documentation.bunnyshell.com/docs/remote-development-debugging)
- [Debugging node.js](https://documentation.bunnyshell.com/docs/remote-development-debugging-nodejs) for both `app` and `api`

 

#### Debugging backend with code from the container

When debugging with remote code, you need to:
1. have the necessary libraries installed in the container image: see [Prepare the container image](https://documentation.bunnyshell.com/docs/remote-development-configure-vs-code-pre-requisites#prepare-the-container-image)
2. install the necessary IDE extensions (if any): see [Prepare VS Code Extensions](https://documentation.bunnyshell.com/docs/remote-development-configure-vs-code-pre-requisites#prepare-vs-code-extensions)
3. start the Remote Development session with no code sync, `--sync-mode none` and (optionally) without an interactive shell once the preparation is done `--no-tty` (See "Working with code from the container" from the current Template description)
4. [configure the IDE SSH connection](https://documentation.bunnyshell.com/docs/remote-development-configure-vs-code-connection)
5. [start the debug process from your IDE](https://documentation.bunnyshell.com/docs/remote-development-configure-vs-code-debug-nodejs)

For the `api` service, you need to run:
```
$ bns remote-development up --sync-mode none --no-tty
? Remote Path /usr/src/app/backend
Pod is ready for Remote Development.
You can find the SSH Config file in /Users/myuser/.bunnyshell/remote-dev/ssh-config
```
💡 Remember that you can pass in the optional flag `--component {YOUR_COMPONENT_ID}` to skip running the wizard to choose the Component.

And within the IDE terminal, you need to start the `node` process with debugging capabilities:
```
/usr/src/app/backend # npm run start:dev
```

You can now add breakpoints and start debugging.

📖 For more information on debugging remotely, please see:
- [Debugging node.js](https://documentation.bunnyshell.com/docs/remote-development-debugging-nodejs) for both `frontend` and `api`
- [Debugging remotely with VS Code](https://documentation.bunnyshell.com/docs/remote-development-configure-vs-code)

 
Expand Down
17 changes: 14 additions & 3 deletions .bunnyshell/templates/express-angular-postgres/bunnyshell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ components:
dockerfile: .docker/Dockerfile
target: dev
environment:
FRONTEND_URL: 'https://{{ components.app.ingress.hosts[0] }}'
FRONTEND_URL: 'https://{{ components.frontend.ingress.hosts[0].hostname }}'
POSTGRES_DB: bunny_books
POSTGRES_HOST: db
POSTGRES_PASSWORD: need-to-replace
Expand Down Expand Up @@ -44,7 +44,7 @@ components:
subPath: ''
-
kind: Application
name: app
name: frontend
gitRepo: 'https://github.com/bunnyshell/templates.git'
gitBranch: angular-books-app/v0.3.0
gitApplicationPath: components/angular-books-app
Expand All @@ -60,7 +60,7 @@ components:
reservations:
memory: 1G
environment:
API_URL: 'https://{{ components.api.ingress.hosts[0] }}'
API_URL: 'https://{{ components.api.ingress.hosts[0].hostname }}'
labels:
kompose.service.healthcheck.readiness.test: 'CMD sh -c "wget --no-verbose --tries=1 --spider http://127.0.0.1:8080 || exit 1"'
kompose.service.healthcheck.readiness.interval: 15s
Expand All @@ -79,3 +79,14 @@ volumes:
name: data-volume
size: 1Gi
type: disk
dev:
api:
-
containers:
api:
remoteDevProfile: api
frontend:
-
containers:
frontend:
remoteDevProfile: frontend
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Express + Angular + PostgreSQL
description: This is a boilerplate for creating a new environment using Node, Express, Angular and PostgreSQL. It contains a basic CRUD example to demonstrate how components connect and make it easy to start with.
tags: [ nodejs, express, angular, typescript, postgres ]
icons: [ nodejs, express, angular, typescript, postgres ]
categories: [ framework ]
stack:
packages:
- name: Node.js
Expand Down
Loading