-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (21 loc) · 740 Bytes
/
Dockerfile
File metadata and controls
28 lines (21 loc) · 740 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.2
# Create user and group
RUN groupadd myapp --gid 6156 && \
useradd --home /home/myapp --create-home --shell /bin/false --uid 6157 --gid 6156 myapp
# Docker Ruby image has some quirks that disallow it from running as a normal user
ENV BUNDLE_APP_CONFIG .
# Run stuff as myapp from now on
USER myapp
# Create and switch to the repo dir
ENV REPO_DIR /home/myapp/repo
RUN mkdir $REPO_DIR
WORKDIR $REPO_DIR
# First install gems
COPY Gemfile $REPO_DIR/
COPY Gemfile.lock $REPO_DIR/
RUN bundle install --deployment --without development test
# Then copy over rest of the app
# .dockerignore will ensure that unnecessary files aren't copied
COPY . $REPO_DIR
# This will be the default command
CMD bundle exec foreman start