-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor(main): remove the localhost from the listenandserve function * build(docker): add a dockerfile to build the container image * build(makefile): add target commands to the makefile to build and run the container
- Loading branch information
1 parent
b5e8baf
commit ebd72fa
Showing
4 changed files
with
51 additions
and
1 deletion.
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,7 @@ | ||
.git | ||
LICENSE | ||
README.md | ||
tmp/ | ||
.dockerignore | ||
.gitignore | ||
docker-compose.yml |
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,27 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
# Build the application from source | ||
FROM golang:1.21 AS builder | ||
|
||
WORKDIR /app | ||
|
||
COPY go.* ./ | ||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o morphos . | ||
|
||
# Deploy the application binary into a lean image | ||
FROM debian:bookworm-slim AS release | ||
|
||
WORKDIR / | ||
|
||
COPY --from=builder /app/morphos /bin/morphos | ||
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["/bin/morphos"] |
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
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