-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (21 loc) · 814 Bytes
/
Dockerfile
File metadata and controls
28 lines (21 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM ruby:2.6.1
LABEL maintainer="Michael Senn <michael@morrolan.ch>"
EXPOSE 8080
# Tiny Init. (Reap zombies, forward signals)
ENV TINI_VERSION v0.17.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
# Create non-privileged user
RUN groupadd -r gorge && useradd -r -g gorge gorge
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Throw error if Gemfile was modified after Gemfile.lock
RUN bundle config --global frozen 1
# Installing gems before copying source allows caching of gem installation.
COPY Gemfile Gemfile.lock /usr/src/app/
ARG BUNDLE_EXCLUDE_GROUPS="development test"
RUN bundle install --without $BUNDLE_EXCLUDE_GROUPS
COPY . /usr/src/app
RUN chmod +x "./docker-entrypoint.sh"
USER gorge
ENTRYPOINT ["/tini", "--", "./docker-entrypoint.sh"]