Skip to content

rizperdana/prototype-golang-rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Requirements

Usage

Clone the repository with:

git clone github.com/rizperdana/prototype-golang-rest

Copy the env.example file to a .env file.

$ cp .env.example .env

Update the postgres variables declared in the new .env to match your preference. There's a handy guide on the Postgres' DockerHub.

Build and start the services with:

$ docker-compose up --build

The database migration files are in db/migrations so feel free to simply source them directly. Alternatively, you can apply them using migrate by running:

$ export POSTGRESQL_URL="postgres://$PG_USER:$PG_PASS@localhost:5432/$PG_DB?sslmode=disable"
$ migrate -database ${POSTGRESQL_URL} -path db/migrations up

NOTE: Remember to replace the $PG* variables with their actual values

Development

After making your changes, you can rebuild the server service by running the commands below

$ docker-compose stop server
$ docker-compose build server
$ docker-compose up --no-start server
$ docker-compose start server

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages