forked from stevegraham/slanger
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (26 loc) · 902 Bytes
/
Dockerfile
File metadata and controls
36 lines (26 loc) · 902 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
29
30
31
32
33
34
35
36
FROM ruby:2.6.3
LABEL maintainer=OceanEx
ARG git_revision_id
# Allow customization of user ID and group ID (it's useful when you use Docker bind mounts)
ARG UID=2000
ARG GID=2000
ENV APP_HOME=/home/app \
GIT_REVISION_ID=${git_revision_id} \
TZ=UTC
# throw errors if Gemfile has been modified since Gemfile.lock
RUN groupadd -r --gid ${GID} app \
&& useradd --system --create-home --home ${APP_HOME} --shell /sbin/nologin --no-log-init \
--gid ${GID} --uid ${UID} app \
# Install system dependencies.
&& apt-get update \
&& gem install bundler:2.2.33
RUN bundle config --global frozen 1
WORKDIR $APP_HOME
COPY Gemfile Gemfile.lock $APP_HOME/
RUN bundle install
COPY --chown=app:app . $APP_HOME
# Switch to application user.
USER app
RUN chmod +x ./bin/slanger
EXPOSE 4567 8080
CMD bundle exec ./bin/slanger --app_key $APP_KEY --secret $APP_SECRET -r $REDIS_URL $VERBOSE_CONFIG