Skip to main content

All Questions

Tagged with
1 vote
0 answers
36 views

How to Set Up Hot Reload for Gin Application Using Docker and Air in Dev Environment?

I'm working on a backend system using Gin and Docker, and I'm trying to set up two different environments: development and production. In the development environment, I want to use Air for hot ...
Samy's user avatar
  • 11
1 vote
0 answers
27 views

Go/Gin dlv debugger doesn't work with docker and vscode

I try to setup dev environment for Gin framework using docker and vscode. I can't figure why the breakpoint is visible in the debug console but seems the breakpoint has no effect. In docker I'm ...
tstr's user avatar
  • 1,286
1 vote
1 answer
260 views

Why can't I access my Gin application from local with Docker?

I am creating a web application with Go and the Gin framework. The idea is to use Docker to be able to run it in a container and also be able to debug it. So my Dockerfile is as follows: FROM golang:1....
Diego L's user avatar
  • 804
3 votes
0 answers
536 views

Go-redis context canceled when calling from Typescript

I am trying to create a web admin dashboard, using Typescript with redux-saga fro frontend and for backend Docker, Golang, Postgres as "main" db and Redis to store access tokens; I followed ...
Deffo's user avatar
  • 175
1 vote
1 answer
121 views

Docker container runs on mac but not windows

I have a docker container for a gin web server. When I try ir on my macbook it runs but on windows docker desktop the container exits with error: exec ./hello: no such file or directory main.go ...
chris's user avatar
  • 21
0 votes
1 answer
293 views

minimal docker for golang gin REST API endpoint

I can build a simple REST API endpoint with gin + golang using this tutorial: $ go mod init translator/golang # <--- arbitrary name, right ? go: creating new go.mod: module translator/golang go: to ...
OrenIshShalom's user avatar
1 vote
0 answers
55 views

After the Golang gin backend is deployed using Docker, upload images and request image response 404

I have a web project that separates the front-end and back-end, using Vue3 for the front-end and Golang's gin framework for the back-end; I have tested the corresponding interfaces before deployment ...
Trainerchan's user avatar
2 votes
1 answer
199 views

Server (serving static reactjs files) in Docker container 404 page not found

I am trying to containerize a Go app that serves static files on port 8000. I have looked at other posts on this topic and many seem to say to use router.Run("0.0.0.0:8000") or router.Run(&...
Alfie Danger's user avatar
0 votes
0 answers
40 views

failed to initialize database, got error dial tcp 127.0.0.1:3306: connect: connection refused panic: An error occured [duplicate]

When I run my code using go run . it runs and the database tables get created successfully, but when I use docker run mybackend:multistage , I get this error: failed to initialize database, got error ...
Joel Swakise TheDancer's user avatar
0 votes
1 answer
1k views

Docker container localhost not exposed [duplicate]

When starting a gin server, I was using router.Run("localhost:8080"). Afterwards, running the docker command docker run -p 8080:8080 <IMAGE_NAME> does not expose the service to my ...
jellypancake's user avatar
1 vote
1 answer
295 views

Why go can't access port 8080 in docker

So I want to deploy my simple Go backend in Cloud Run. I use Gin to handle the routing. My main function that handle it look like this: func main() { r := gin.Default() r.GET("/api/health&...
Farid Cenreng C038DSX0869's user avatar
5 votes
1 answer
10k views

service "app" depends on undefined service db: invalid compose project

I build a Go server in Gin framework and now I want to deploy it to GCP. I am trying to run docker compose up -d on VM in GCP Compute Engine. The command successfully runs in my local machine but ...
Kadirbek Sharau's user avatar
1 vote
1 answer
1k views

Docker: Go server does not respond

I was learning how to dockerize Go Apps. I created a simple REST API package main import "github.com/gin-gonic/gin" func main() { server := gin.Default() server.GET("/", ...
ashab999's user avatar
0 votes
2 answers
1k views

Docker golang gin postgres

I am trying to set up a docker for golang app with Postgres. The go app works fine in a container if I remove/comment Postgres. And similarly, I am able to spin up Postgres container and log into it. ...
Anurag Bhardwaj's user avatar