-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
823d002
commit c667cc2
Showing
3 changed files
with
16 additions
and
10 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 |
---|---|---|
@@ -1,4 +1,2 @@ | ||
# Following source doesn't work in most setups | ||
ignored: | ||
- SC1090 | ||
- SC1091 | ||
- DL3008 |
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,7 +1,3 @@ | ||
enable=all | ||
source-path=SCRIPTDIR | ||
disable=SC2154 | ||
|
||
# If you're having issues with shellcheck following source, disable the errors via: | ||
# disable=SC1090 | ||
# disable=SC1091 |
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 |
---|---|---|
|
@@ -19,8 +19,8 @@ COPY ./lib ./lib | |
|
||
# Copy and modify go.work file | ||
COPY ./go.work ./ | ||
RUN sed -i '/^[[:space:]]*\.\/sdk\//d' ./go.work | ||
RUN sed -i '/^[[:space:]]*\.\/.*\/testdata/d' ./go.work | ||
RUN sed -i '/^[[:space:]]*\.\/sdk\//d' ./go.work && \ | ||
sed -i '/^[[:space:]]*\.\/.*\/testdata/d' ./go.work | ||
|
||
# switch to the runtime directory | ||
WORKDIR /src/runtime | ||
|
@@ -42,12 +42,17 @@ RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o modus_runtime -ldflags "-s -w | |
FROM ubuntu:22.04 | ||
LABEL maintainer="Hypermode Inc. <[email protected]>" | ||
|
||
# Create a custom group and user | ||
RUN groupadd -g 1234 modus && \ | ||
useradd -m -u 1234 -g modus modus | ||
|
||
# add common tools | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
curl \ | ||
iputils-ping \ | ||
jq \ | ||
less | ||
less \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# copy runtime binary from the build phase | ||
COPY --from=builder /src/runtime/modus_runtime /usr/bin/modus_runtime | ||
|
@@ -58,5 +63,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ | |
tzdata \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Switch to the custom user and set the working directory | ||
USER modus | ||
WORKDIR /home/modus | ||
|
||
# set the default entrypoint and options | ||
ENTRYPOINT ["modus_runtime", "--jsonlogs"] | ||
|
||
# define the health check for the container | ||
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 CMD curl -f http://localhost:8686/health | jq -e '.status == "ok"' > /dev/null || exit 1 |