Skip to content

loild193/go-simple-crud

Repository files navigation

Simple CRUD using Go

Stacks:

  • Go
  • Gin framework
  • Air for hot reloading
  • Postgres database
  • Adminer

Prerequisite:

  • Docker

How to Start

  • Create .env from .env.example with your own modifications:
cp .env.example .env

Fill the value with your own setup

  • Create .env.production.docker from .env.production.docker.example with your own modifications:
cp .env.production.docker.example .env.production.docker

Fill the value with your own setup

  • Grant permission for docker-entrypoint.sh:
chmod +x docker-entrypoint.sh
  • Run command on dev stage:
docker compose -f docker-compose.dev.yml up -d --build 

After that, execute server container with:

docker compose exec go_simple_crud sh

& run below command to start dev server:

air -c .air.toml
  • Run command on production stage:
docker compose up -d --build