-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.dev
83 lines (53 loc) · 2.08 KB
/
Dockerfile.dev
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
FROM ruby:2.6.1
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 nodejs vim libmagic-dev
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/pluck}
ENV APP_DIR=${RAILS_ROOT}/app
RUN mkdir -p $RAILS_ROOT
RUN mkdir ${APP_DIR}
RUN mkdir ${RAILS_ROOT}/config
# Set working directory
WORKDIR $RAILS_ROOT
# Setting env up
ARG RAILS_ENV=${RAILS_ENV:-development}
ENV RAILS_ENV=$RAILS_ENV
ENV RACK_ENV=${RAILS_ENV}
# Adding gems
RUN gem install bundler:2.0.1
COPY Gemfile Gemfile
COPY Gemfile.lock Gemfile.lock
RUN bundle install --jobs 20 --retry 5 --without test
# # Adding project files
COPY bin ./bin
ENV SECRET_KEY_BASE=${SECRET_KEY_BASE:-c959724279db5ca746e7a88}
COPY Rakefile package.json postcss.config.js babel.config.js ./
RUN yarn install --check-files
COPY app/assets ${APP_DIR}/assets
COPY app/javascript ${APP_DIR}/javascript
COPY vendor ${RAILS_ROOT}/vendor
# COPY config/webpack config/webpacker.yml ${RAILS_ROOT}/config/
# RUN mkdir -p ${RAILS_ROOT}/config/initializers
# RUN mkdir ${RAILS_ROOT}/config/webpack
# RUN mkdir ${RAILS_ROOT}/config/environments
COPY config/webpack ./config/webpack
COPY config/webpacker.yml ./config/webpacker.yml
COPY config/initializers ./config/initializers
COPY config/environments ./config/environments
COPY config/application.rb ./config/application.rb
COPY config/application.yml ./config/application.yml
COPY config/boot.rb ./config/boot.rb
# COPY config ./config
COPY config/environment.rb ./config/environment.rb
# RUN bundle exec rake assets:precompile
COPY . .
ENV CI=true
# RUN yarn install --check-files --production=true
# VOLUME [ "${APP_DIR}", "${RAILS_ROOT}/config" ]
# VOLUME [ "${RAILS_ROOT}/public", "/var/www/repos" ]
# ENV SECRET_KEY_BASE=${SECRET_KEY_BASE:-c959724279db5ca746e7a88}
EXPOSE 3000
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]
# bundle exec puma -C config/puma.rb