Skip to content

Commit

Permalink
Update emailservice Dockerfile to use alpine and multistage build (#703)
Browse files Browse the repository at this point in the history
* Update emailservice Dockerfile

Signed-off-by: svrnm <neumanns@cisco.com>

* Use alpine

Signed-off-by: svrnm <neumanns@cisco.com>

* Add changelog

Signed-off-by: svrnm <neumanns@cisco.com>

* newline

Signed-off-by: svrnm <neumanns@cisco.com>

* Update CHANGELOG.md

* Update .dockerignore

Signed-off-by: svrnm <neumanns@cisco.com>
Co-authored-by: Juliano Costa <julianocosta89@outlook.com>
  • Loading branch information
svrnm and julianocosta89 committed Jan 24, 2023
1 parent 842a11a commit c1591d3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,5 @@ significant modifications will be credited to OpenTelemetry Authors.
([#700](https://github.com/open-telemetry/opentelemetry-demo/pull/700))
* Reduce spans generated from quote service
([#702](https://github.com/open-telemetry/opentelemetry-demo/pull/702))
* Update emailservice Dockerfile to use alpine and multistage build
([#703](https://github.com/open-telemetry/opentelemetry-demo/pull/703))
1 change: 1 addition & 0 deletions src/emailservice/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README.md
16 changes: 13 additions & 3 deletions src/emailservice/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
FROM ruby:3.1.2-slim
FROM ruby:3.1.2-alpine as base

RUN apt-get update -y && apt-get install -y build-essential
FROM base as builder

WORKDIR /tmp

COPY Gemfile Gemfile.lock .

RUN apk update && apk add make gcc musl-dev && bundle install

FROM base as release

WORKDIR /email_server

COPY . .

RUN bundle install
RUN chmod 666 ./Gemfile.lock

COPY --from=builder /usr/local/bundle/ /usr/local/bundle/


EXPOSE ${EMAIL_SERVICE_PORT}
ENTRYPOINT ["bundle", "exec", "ruby", "email_server.rb"]

0 comments on commit c1591d3

Please sign in to comment.