Skip to content
This repository has been archived by the owner on Feb 3, 2024. It is now read-only.

ankraio/docs-golang-postgresql-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go-Postgres

This project is simple CRUD application built in golang and using PostgreSQL as DB.

Pre-requisite

  1. Install golang v1.11 or above.
  2. Install PostgreSQL v10 or above.
  3. Create Database and table

PostgreSQL Table

CREATE TABLE users (
  userid SERIAL PRIMARY KEY,
  name TEXT,
  age INT,
  location TEXT
);

Build Development Docker Image

docker build --target development  -t golang:dev .

Build Production Docker Image

docker build --target production  -t golang:prod .

Run Development Docker Image

docker run -it --rm -p 8080:8080 golang:dev

Run Production Docker Image

docker run -it --rm -p 8080:8080 golang:prod

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published