-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from Yinebeb-01/fix-build
docker build fixed
- Loading branch information
Showing
4 changed files
with
7 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,4 @@ | |
services/test.db | ||
.idea/* | ||
/godog_dependency_file_test.go | ||
/simpleapi.log | ||
/hexagonal_arch.log | ||
/app.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,23 @@ | ||
# Start from the latest golang base image | ||
FROM golang:latest | ||
|
||
# Add Maintainer Info | ||
LABEL maintainer="Yinebeb <[email protected]>" | ||
|
||
# Set the Current Working Directory inside the container | ||
WORKDIR /app | ||
|
||
# Copy Go Modules dependency requirements file | ||
COPY go.mod . | ||
|
||
# Copy Go Modules expected hashes file | ||
COPY go.sum . | ||
|
||
# Download dependencies | ||
RUN go mod download | ||
|
||
# Copy all the app sources (recursively copies files and directories from the host into the image) | ||
COPY . . | ||
|
||
# Set rest port | ||
ENV PORT 5000 | ||
|
||
# Build the app | ||
RUN go build | ||
RUN go build -o app cmd/main.go | ||
|
||
# Remove source files | ||
RUN find . -name "*.go" -type f -delete | ||
|
||
# Make port 5000 available to the world outside this container | ||
EXPOSE $PORT | ||
|
||
# Run the app | ||
CMD ["./hexagonal_arch"] | ||
CMD ["./app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,8 +29,8 @@ var ( | |
|
||
// @title hexagonal-architecture | ||
// @version 0.1.0 | ||
// @contact.name yinebe-tariku | ||
// @contact.url https://www.linkedin.com/yinebeb-tariku | ||
// @contact.name Yinebe T. | ||
// @contact.url www.linkedin.com/in/yinebeb-tariku | ||
// @contact.email [email protected] | ||
// @host localhost | ||
// @BasePath /v1 | ||
|
@@ -63,7 +63,7 @@ func main() { | |
|
||
// configOutput create a custom logger file to see debugging outputs. | ||
func configOutput() { | ||
writer, err := os.Create("hexagonalarch.log") | ||
writer, err := os.Create("app.log") | ||
if err != nil { | ||
log.Println("unable to create log file") | ||
} | ||
|