Skip to content

Commit

Permalink
feat: add build files
Browse files Browse the repository at this point in the history
  • Loading branch information
llucasreis committed Sep 9, 2021
1 parent cd2fe13 commit 0c63217
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions Buildfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
make: ./build.sh
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM golang:latest

WORKDIR /app

COPY go.mod .
COPY go.sum .

RUN go mod download

COPY . .

ENV PORT 5000

# Build the app
RUN go build

# Remove source files
RUN find . -name "*.go" -type f -delete

EXPOSE $PORT

# Run the app
CMD ["./go-gin"]
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: bin/application
10 changes: 10 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/bash
set -xe

# install packages
go get github.com/gin-gonic/gin

go get github.com/go-playground/validator/v10

# build command
go build -o bin/application server.go

0 comments on commit 0c63217

Please sign in to comment.