{"id":25948783,"url":"https://github.com/jaygaha/go-docker-beginner-template","last_synced_at":"2026-05-02T11:42:18.678Z","repository":{"id":280374744,"uuid":"941775317","full_name":"jaygaha/go-docker-beginner-template","owner":"jaygaha","description":"Beginner friendly Golang web application using Docker","archived":false,"fork":false,"pushed_at":"2025-03-03T03:13:41.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T04:23:10.367Z","etag":null,"topics":["beginner-friendly","docker","docker-compose","go","golang","golang-api"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaygaha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-03T03:01:29.000Z","updated_at":"2025-03-03T03:15:36.000Z","dependencies_parsed_at":"2025-03-03T04:33:14.831Z","dependency_job_id":null,"html_url":"https://github.com/jaygaha/go-docker-beginner-template","commit_stats":null,"previous_names":["jaygaha/go-docker-beginner-template"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaygaha%2Fgo-docker-beginner-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaygaha%2Fgo-docker-beginner-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaygaha%2Fgo-docker-beginner-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaygaha%2Fgo-docker-beginner-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaygaha","download_url":"https://codeload.github.com/jaygaha/go-docker-beginner-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241836972,"owners_count":20028282,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["beginner-friendly","docker","docker-compose","go","golang","golang-api"],"created_at":"2025-03-04T11:22:33.055Z","updated_at":"2026-05-02T11:42:18.642Z","avatar_url":"https://github.com/jaygaha.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Golang Beginner Using Docker\n\nThis template is designed to help you get started with Go and Docker. Follow the steps below to set up your development environment and run your first Go application inside a Docker container.\n\n## Prerequisites\n\nBefore you begin, make sure you have the following installed on your system:\n\n- [Go](https://golang.org/doc/install) (version 1.24 or later)\n- [Docker](https://docs.docker.com/get-docker/)\n\n## Installation Guide\n\n### Step 1: Clone the Repository\n\nFirst, clone this repository to your local machine using the following command:\n\n```sh\ngit clone https://github.com/jaygaha/go-docker-beginner-template.git\ncd go-docker-beginner-template\n```\n\n### Step 2: Write Your First Go Program\n\nCreate a new Go file named `main.go` in the project directory with the following content:\n\n```go\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n    fmt.Println(\"Hello, World!\")\n}\n```\n\n### Step 3: Dockerfile template\n\nCreate a `Dockerfile` in the project directory with the following content:\n\n```Dockerfile\n# Use the official Golang image\nFROM golang:1.24\n\n# Set the working directory inside the container\nWORKDIR /var/www/html\n\n# Copy the Go source code to the container\nCOPY . .\n\n# Build the Go application\nRUN go build -o main .\n\n# Command to run the executable\nCMD [\"./main\"]\n```\n\n### Step 4: Build the Docker\n\nBuild using docker compose command:\n\n```sh\ndocker compose build\n```\n\nOR\n\nBuild the Docker image using the following command:\n\n```sh\ndocker build -t golang-beginner .\n```\n\n### Step 5: Run the Docker Container\n\nRun using docker compose command:\n\n```sh\ndocker compose up -d\n```\n\nOR\n\nRun the Docker container using the following command:\n\n```sh\ndocker run --rm golang-beginner\n```\n\nYou should see the output `Hello, World!` in your browser.\n\n## Conclusion\n\nCongratulations! You have successfully set up a Go development environment and run your first Go application inside a Docker container. Feel free to explore and modify the code to learn more about Go and Docker.\n\nHappy coding!\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaygaha%2Fgo-docker-beginner-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaygaha%2Fgo-docker-beginner-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaygaha%2Fgo-docker-beginner-template/lists"}