API for managing Good News user accounts.
Setup GOPATH
and GOBIN
environment variables:
export GOPATH=$(pwd)/src
export GOBIN=$GOPATH/bin
Set the environment variables for postgres and application secret:
DB_HOST=
DB_USER=
DB_PASS=
DB_NAME=
SCHEMA=
JWT_KEY=
The database should have a users table like so:
create table users
(
id serial not null
constraint users_pk
primary key,
email varchar(255) not null,
password varchar(255) not null,
refresh_token varchar(255),
created_at timestamp default CURRENT_TIMESTAMP not null,
updated_at timestamp default CURRENT_TIMESTAMP
);
create unique index users_email_uindex
on users (email);
cd ./src && go build -a -installsuffix cgo -o main .
./src/main
Build and tag the docker image. Or run with:
docker-compose up --build -d