-
Notifications
You must be signed in to change notification settings - Fork 322
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 #448 from hellofresh/patch/docker-image-ubuntu
EES-574 Use ubuntu for docker image and run as nobody
- Loading branch information
Showing
1 changed file
with
14 additions
and
11 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,30 +1,33 @@ | ||
FROM golang:1.14-alpine AS builder | ||
|
||
ARG VERSION='0.0.1-docker' | ||
ENV VERSION $VERSION | ||
|
||
WORKDIR /janus | ||
|
||
COPY . ./ | ||
|
||
RUN apk add --update bash make git | ||
RUN export JANUS_BUILD_ONLY_DEFAULT=1 && \ | ||
export VERSION=$VERSION && \ | ||
make build | ||
RUN export JANUS_BUILD_ONLY_DEFAULT=1 make build | ||
|
||
# --- | ||
|
||
FROM alpine | ||
FROM ubuntu:20.04 | ||
|
||
COPY --from=builder /janus/dist/janus / | ||
|
||
RUN apk add --no-cache ca-certificates | ||
RUN mkdir -p /etc/janus/apis && \ | ||
COPY --from=builder /janus/dist/janus /bin/janus | ||
RUN chmod a+x /bin/janus && \ | ||
mkdir -p /etc/janus/apis && \ | ||
mkdir -p /etc/janus/auth | ||
|
||
RUN apk add --update curl && \ | ||
rm -rf /var/cache/apk/* | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
curl \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
HEALTHCHECK --interval=5s --timeout=5s --retries=3 CMD curl -f http://localhost:8081/status || exit 1 | ||
|
||
# Use nobody user + group | ||
USER 65534:65534 | ||
|
||
EXPOSE 8080 8081 8443 8444 | ||
ENTRYPOINT ["/janus", "start"] | ||
ENTRYPOINT ["/bin/janus", "start"] |