Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]: Dockerizing Nymeria #10

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -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/
2 changes: 2 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
POSTGRES_USER=postgres username
POSTGRES_PASSWORD=postgres password
3 changes: 3 additions & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ nymeria

# miscellaneous
.vscode/

# Env files
.env
Empty file modified .golangci.yml
100644 → 100755
Empty file.
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified Makefile
100644 → 100755
Empty file.
6 changes: 6 additions & 0 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,9 @@ Add new packages to the repository using the command
```sh
go get -u <package_path>
```

To run nymeria using docker, run the following command

```sh
docker-compose up --build -d
```
Empty file modified api/main.go
100644 → 100755
Empty file.
Empty file modified cmd/nymeria/main.go
100644 → 100755
Empty file.
26 changes: 26 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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:
Empty file modified go.mod
100644 → 100755
Empty file.
Empty file modified go.sum
100644 → 100755
Empty file.
Empty file modified pkg/.gitkeep
100644 → 100755
Empty file.