-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathDockerfile
71 lines (61 loc) · 1.73 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Docker script made with the help of
# http://blog.gemnasium.com/post/66356385701/your-dockerfile-for-rails
# -*- sh -*-
FROM debian:wheezy
# development tools
RUN apt-get update && apt-get -qy install git build-essential libpq-dev libv8-dev
#Prerequisits for ruby build
RUN apt-get install -q -y \
curl \
patch \
bzip2 \
gawk \
g++ \
gcc \
make \
libc6-dev \
patch \
libsqlite3-dev \
sqlite3 \
libreadline6-dev \
zlib1g-dev \
libssl-dev \
libyaml-dev \
autoconf \
libgdbm-dev \
libncurses5-dev \
automake \
libtool \
bison \
pkg-config \
libffi-dev
# Install Ruby 2.1.5
RUN mkdir /tmp/ruby && cd /tmp/ruby && \
curl http://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.5.tar.gz | tar xz && \
cd ruby-2.1.5 && \
./configure --disable-install-rdoc --prefix=/usr/local --enable-shared --disable-install-doc --with-opt-dir=/usr/local/lib --with-openssl-dir=/usr --with-readline-dir=/usr --with-zlib-dir=/usr && \
make && \
make install && \
rm -rf /tmp/ruby
# Install bundler gem
RUN gem install bundler --no-ri --no-rdoc
# copy the Rails app
# we assume we have cloned the "docrails" repository locally
# and it is clean; see the "prepare" script
RUN git clone https://github.com/acaciasforall/acacias-harvest.git /rails
# create a "rails" user
# the Rails application will live in the /rails directory
RUN adduser --disabled-password --home=/rails --gecos "" rails
# Make sure we have rights on the rails folder
RUN chown rails -R /rails
# copy and execute the setup script
# this will run bundler, setup the database, etc.
ADD docker_scripts/setup /setup
RUN chmod +x /setup
RUN su rails -c /setup
# copy the start script
ADD docker_scripts/start /start
RUN chmod +x /start
EXPOSE 3000
USER rails
CMD /start