diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6ae93fa --- /dev/null +++ b/.dockerignore @@ -0,0 +1,23 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +vendor/ +v1.46.2/ + +# Exclude the binary +nymeria +!nymeria/ + +# miscellaneous +.vscode/ diff --git a/.env.sample b/.env.sample new file mode 100644 index 0000000..68d527e --- /dev/null +++ b/.env.sample @@ -0,0 +1,2 @@ +POSTGRES_USER=postgres username +POSTGRES_PASSWORD=postgres password \ No newline at end of file diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index 6ae93fa..3ee407f --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,6 @@ nymeria # miscellaneous .vscode/ + +# Env files +.env \ No newline at end of file diff --git a/.golangci.yml b/.golangci.yml old mode 100644 new mode 100755 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..41e3762 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM golang:1.17-alpine + +WORKDIR /usr/app + +COPY . /usr/app/ + +RUN apk add --update make + +RUN make vendor + +RUN make build + +EXPOSE 8080 + +CMD ["make","run"] diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 6cc742a..a631c4a --- a/README.md +++ b/README.md @@ -52,3 +52,9 @@ Add new packages to the repository using the command ```sh go get -u ``` + +To run nymeria using docker, run the following command + +```sh + docker-compose up --build -d +``` \ No newline at end of file diff --git a/api/main.go b/api/main.go old mode 100644 new mode 100755 diff --git a/cmd/nymeria/main.go b/cmd/nymeria/main.go old mode 100644 new mode 100755 diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..7a812d2 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,26 @@ +version: "3.8" + +services: + server: + container_name: nymeria + build: + context: ./ + dockerfile: Dockerfile + ports: + - "8080:8080" + restart: always + depends_on: + - postgres_db + + postgres_db: + image: postgres:14.1-alpine + restart: always + environment: + - POSTGRES_USER=${POSTGRES_USER} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + ports: + - '5432:5432' + volumes: + - pgdata:/var/lib/postgresql/data +volumes: + pgdata: \ No newline at end of file diff --git a/go.mod b/go.mod old mode 100644 new mode 100755 diff --git a/go.sum b/go.sum old mode 100644 new mode 100755 diff --git a/pkg/.gitkeep b/pkg/.gitkeep old mode 100644 new mode 100755