Skip to content

Commit

Permalink
Merge pull request #448 from hellofresh/patch/docker-image-ubuntu
Browse files Browse the repository at this point in the history
EES-574 Use ubuntu for docker image and run as nobody
  • Loading branch information
vgarvardt authored Aug 17, 2020
2 parents a3b8a78 + 90dcf4a commit 5bdca27
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions Dockerfile
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"]

0 comments on commit 5bdca27

Please sign in to comment.