Sign inSign up

carlosdhc333/go_holamundo

By carlosdhc333

β€’Updated almost 2 years ago

Image
0

85

carlosdhc333/go_holamundo repository overview

β πŸ“š Repository Overview

β πŸ’» Project Description

This repository contains a simple Go application that serves a "Hello World" message through an HTTP server. The project is Dockerized to facilitate containerization and deployment to platforms like Docker Hub or Render.

β πŸ—οΈ Project Structure

The directory structure of the project is as follows:

Go_holamundo/ β”‚ β”œβ”€β”€ Dockerfile # Instructions for Docker to build the application container β”œβ”€β”€ go.mod # Go module file, contains project dependencies β”œβ”€β”€ go.sum # Go sum file, ensures correct versions of dependencies └── main.go # Main Go application file that runs the HTTP server

β πŸ”§ Setup & Installation

⁠Requirements:
⁠Installation Steps:
  1. Clone the repository to your local machine:

git clone https://github.com/Carlosdhc333/Go_holamundo.git⁠

2.- Navigate to the project directory:

cd Go_holamundo

3.- Initialize the Go module and download dependencies:

go mod tidy

β πŸƒ Running the Application Locally

To run the Go application on your local machine, use the following command:

go run main.go

This will start an HTTP server on port 8080. You can access it by navigating to http://localhost:8080⁠ in your web browser.

⁠🐳 Dockerizing the Application

To build and run the application inside a Docker container, follow these steps:

1.- Build the Docker image:

docker build -t carlosdhc333/go_holamundo:v1 .

2.- Run the Docker container:

docker run --rm -p 8080:8080 carlosdhc333/go_holamundo:v1

This will make the application available on http://localhost:8080⁠ inside the container

⁠🌍 Pushing to Docker Hub (Optional)

If you'd like to share the Docker image, you can push it to Docker Hub:

1.- Log in to Docker Hub:

docker login

2.- Tag the image:

docker tag carlosdhc333/go_holamundo:v1 your_username/go_holamundo

3.- Push the image to Docker Hub:

docker push your_username/go_holamundo

β πŸ“ˆ Deployment to Render (Optional)

To deploy this project on Render:

1.- Upload the repository to GitHub.

2.- In the Render dashboard, click on "New" > "Web Service" and connect your GitHub repository.

3.- Set the command to run your application, such as go run main.go.

Render will build the Docker image and run the application, displaying the output in the service log.

β πŸŽ‰ Contributing

Feel free to fork this repository and submit pull requests if you want to contribute to improving this project.

β πŸ“ License

This project is licensed under the MIT License.

You can now copy and paste this markdown into your repository’s README.md file. Let me know if you need any further help!

Tag summary

Content type

Image

Digest

sha256:ac82c66d7…

Size

95 MB

Last updated

almost 2 years ago

docker pull carlosdhc333/go_holamundo:v1