-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
62 lines (42 loc) · 1.47 KB
/
Dockerfile.dev
File metadata and controls
62 lines (42 loc) · 1.47 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
FROM ruby:2.6.6-slim-stretch as main
RUN apt-get update && apt install -y curl
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
# RUN apt-get update && apt-get install -y cmake npm
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
npm \
libpq-dev \
vim \
libmagic-dev \
pkg-config \
git
RUN npm install yarn --global
# Set an environment variable where the Rails app is installed to inside of Docker image
ENV RAILS_ROOT ${RAILS_ROOT:-/var/www/layerkeep}
ENV APP_DIR=${RAILS_ROOT}/app
RUN mkdir -p $RAILS_ROOT
RUN mkdir ${APP_DIR}
# Set working directory
WORKDIR $RAILS_ROOT
# Setting env up
ARG RAILS_ENV=${RAILS_ENV:-production}
ENV RAILS_ENV=$RAILS_ENV
ENV RACK_ENV=${RAILS_ENV}
# Adding gems
COPY Gemfile Gemfile
COPY Gemfile.lock Gemfile.lock
RUN bundle install --jobs 20 --retry 5 --without test
# Adding project files
COPY package.json yarn.lock ./
RUN if [ "$RAILS_ENV" = "production" ] ; then yarn install --check-files --production=true ; else yarn install --check-files ; fi
ARG SECRET_KEY_BASE
ENV SECRET_KEY_BASE=${SECRET_KEY_BASE}
COPY . .
# RUN yarn install --check-files --production=true
RUN git config --global user.email web@layerkeep.com && git config --global user.name LayerKeep
# RUN chmod +x "${APP_DIR}/services/scripts/scad.sh"
# VOLUME [ "${APP_DIR}", "${RAILS_ROOT}/config" ]
# VOLUME [ "${RAILS_ROOT}/public", "/var/www/repos" ]
EXPOSE 3000
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]