forked from teracyhq/dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-dev
More file actions
29 lines (19 loc) · 747 Bytes
/
Dockerfile-dev
File metadata and controls
29 lines (19 loc) · 747 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
FROM ruby:2.4.0
LABEL authors="hoatle <hoatle@teracy.com>"
RUN useradd --user-group --create-home --shell /bin/false app && mkdir -p /opt/app
ENV HOME=/home/app TERM=xterm-256color APP=/opt/app
# add more arguments from CI to the image so that `$ env` should reveal more info
ARG CI_BUILD_ID
ARG CI_BUILD_REF
ARG CI_REGISTRY_IMAGE
ARG CI_PROJECT_NAME
ARG CI_BUILD_REF_NAME
ARG CI_BUILD_TIME
ENV CI_BUILD_ID=$CI_BUILD_ID CI_BUILD_REF=$CI_BUILD_REF CI_REGISTRY_IMAGE=$CI_REGISTRY_IMAGE \
CI_PROJECT_NAME=$CI_PROJECT_NAME CI_BUILD_REF_NAME=$CI_BUILD_REF_NAME CI_BUILD_TIME=$CI_BUILD_TIME
ADD Gemfile Gemfile.lock $APP/
RUN chown -R app $APP && chgrp -R app $APP \
&& chown -R app /usr/local
WORKDIR $APP
USER app
RUN bundle install