create-go-app / cli

✨ A complete and self-contained solution for developers of any qualification to create a production-ready project with backend (Go), frontend (JavaScript, TypeScript) and deploy automation (Ansible, Docker) by running only one CLI command.
https://github.com/create-go-app/cli/wiki
Apache License 2.0
2.62k stars 262 forks source link

Getting error dial tcp: no such host #105

Closed mofodox closed 3 years ago

mofodox commented 3 years ago

Required check list:

My environment:

Describe the bug:

How do I run the backend application. I've followed the instructions from the README.md in the backend folder but I kept getting this error:

migrate -path /Users/mofodox/Documents/projects/cgapptest/backend/platform/migrations -database "postgres://postgres:password@cgapp-postgres/postgres?sslmode=disable" up
error: dial tcp: lookup cgapp-postgres on 192.168.1.254:53: no such host
make: *** [migrate.up] Error 1

Steps to reproduce the behavior:

  1. Run the cgapp create command
  2. Choose the options available
  3. Rename the .env.example to .env (backend folder)
  4. Installed golang-migrate, gosec, swagger
  5. Run the application using the make command: make docker.run

Thank you!

koddr commented 3 years ago

Hi,

Check if you have the Docker App installed and running.

mofodox commented 3 years ago

Hi @koddr,

Yes the Docker is running on my machine when I tried to run the backend server running ‘make docker.run’ command

koddr commented 3 years ago

But that's what the error says:

error: dial tcp: lookup cgapp-postgres on 192.168.1.254:53: no such host

Migration cannot be done to a disabled Docker container with a database 🤷

Please try to run this command separately:

docker network create -d bridge dev-network

docker run --rm -d \
  --name cgapp-postgres \
  --network dev-network \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=password \
  -e POSTGRES_DB=postgres \
  -v ${HOME}/dev-postgres/data/:/var/lib/postgresql/data \
  -p 5432:5432 \
  postgres
stale[bot] commented 3 years ago

👋 Hello. Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 3 years ago

⚡️ This issue has been automatically closed because it has not had recent activity.