Skip to content

WIP Draft - Example that deploys a golang backend, postgres db and a react frontend where they all talk with each other#83

Draft
psankar wants to merge 4 commits into
unikraft-cloud:mainfrom
psankar:go-postgres-react
Draft

WIP Draft - Example that deploys a golang backend, postgres db and a react frontend where they all talk with each other#83
psankar wants to merge 4 commits into
unikraft-cloud:mainfrom
psankar:go-postgres-react

Conversation

@psankar

@psankar psankar commented May 31, 2024

Copy link
Copy Markdown

No description provided.

@psankar psankar changed the title go-postgres-react WIP Draft - Example that deploys a golang backend, postgres db and a react frontend where they all talk with each other May 31, 2024
@psankar psankar marked this pull request as draft May 31, 2024 13:24
@razvand razvand self-assigned this Jun 5, 2024
@razvand razvand self-requested a review June 5, 2024 06:22

@razvand razvand left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @psankar . Thanks so much for your contribution.

I tested it. Some remarks:

  • Use a stable name (such as postgres-go-react) for hardcoded instances, in order to allow connection.
  • Either use --metro <metroname> or do not use it. But be consistent.
  • Remove extra white lines.
  • Squash your commits into one.

There are some small items to fix, but let's get these out of the way first.

var err error
db, err = sql.Open(
"postgres",
"user=postgres dbname=postgres password=unikraft host=postgres-wahr0.internal sslmode=disable",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"user=postgres dbname=postgres password=unikraft host=postgres-wahr0.internal sslmode=disable",
"user=postgres dbname=postgres password=unikraft host=postgres-go-react.internal sslmode=disable",


github.com/kraftcloud/examples/postgres$ kraft cloud volume create --name postgres --size 200

github.com/kraftcloud/examples/postgres$ kraft cloud deploy --metro fra0 -M 1024 -e POSTGRES_PASSWORD=unikraft -e PGDATA=/volume/postgres -v postgres:/volume -p 5432:5432/tls .

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
github.com/kraftcloud/examples/postgres$ kraft cloud deploy --metro fra0 -M 1024 -e POSTGRES_PASSWORD=unikraft -e PGDATA=/volume/postgres -v postgres:/volume -p 5432:5432/tls .
github.com/kraftcloud/examples/postgres$ kraft cloud deploy -M 1024 --name postgres-go-react -e POSTGRES_PASSWORD=unikraft -e PGDATA=/volume/postgres -v postgres:/volume -p 5432:5432/tls .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants