-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile
35 lines (26 loc) · 890 Bytes
/
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
# -*- sh -*-
FROM fcat/ubuntu-universe:12.04
# development tools
RUN apt-get -qy install git vim tmux
# ruby 1.9.3 and build dependencies
RUN apt-get -qy install ruby1.9.1 ruby1.9.1-dev build-essential libpq-dev libv8-dev libsqlite3-dev
# bundler
RUN gem install bundler
# create a "rails" user
# the Rails application will live in the /rails directory
RUN adduser --disabled-password --home=/rails --gecos "" rails
# copy the Rails app
# we assume we have cloned the "docrails" repository locally
# and it is clean; see the "prepare" script
ADD docrails/guides/code/getting_started /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 scripts/setup /setup
RUN su rails -c /setup
# copy the start script
ADD scripts/start /start
EXPOSE 3000
USER rails
CMD /start