forked from MohamedElashri/Snibox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
47 lines (31 loc) · 1.01 KB
/
Dockerfile
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
FROM ruby:2.6.8-alpine
RUN apk add --no-cache \
git \
build-base \
tzdata \
nodejs \
yarn \
sqlite-dev \
bash \
postgresql-dev \
python2
WORKDIR /app
ENV RAILS_SERVE_STATIC_FILES=true
ENV RAILS_ENV production
ENV RACK_ENV production
ENV NODE_ENV production
ENV SECRET_KEY_BASE="08898973823f6f1d121ce30fb8adc1c559dcfc08f358cfc0298e4aad81b8c9d798e8249e3a4b26c04255cf8b2d71eaf8eda865d173ae3fe6fb1a599d1b1fa260"
RUN git clone https://github.com/MohamedElashri/snibox-1 /app && cd /app
COPY . /app
RUN bundle update --bundler
RUN gem install bundler:1.17.2
RUN bundle update rails
RUN echo "gem 'sqlite3', '~> 1.3.6'" >> Gemfile && gem install bundler && bundle install
VOLUME /app/db/database
RUN yarn install --check-files; bundle exec rake assets:precompile
RUN apk del \
git \
python2 \
build-base
EXPOSE 3000
CMD if [ -f /app/tmp/pids/server.pid ]; then rm -f /app/tmp/pids/server.pid; fi && cd /app && bundle exec rake 'db:migrate' && bundle exec rails server -b 0.0.0.0