Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement full docker build #514

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
# We don't use this repo's files to build the Docker image, we just gem install
*
30 changes: 24 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
FROM ruby:3.0-alpine
MAINTAINER Samuel Cochran <[email protected]>
### BUILD
FROM ruby:3.0-alpine as build

ARG VERSION=0.8.2
RUN apk update --no-cache --force \
&& apk add --no-cache \
build-base \
sqlite-libs \
sqlite-dev

RUN apk add --no-cache build-base sqlite-libs sqlite-dev && \
gem install mailcatcher -v $VERSION && \
apk del --rdepends --purge build-base sqlite-dev
WORKDIR /app
COPY . .
RUN gem build mailcatcher.gemspec --output=mailcatcher.gem

## FINAL
FROM ruby:3.0-alpine as final
LABEL maintainer="Samuel Cochran <[email protected]>"

WORKDIR /app
COPY --from=build /app/mailcatcher.gem /app/mailcatcher.gem
RUN apk update --no-cache --force \
&& apk add sqlite-libs \
&& apk add --no-cache --virtual build \
build-base \
sqlite-dev \
&& gem install /app/mailcatcher.gem \
&& apk del build

EXPOSE 1025 1080

Expand Down