-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathDockerfile
38 lines (28 loc) · 951 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
36
37
38
FROM ruby:2.3.3
LABEL maintainers Ferran Rodenas <frodenas@gmail.com>, Dr Nic Williams <drnicwilliams@gmail.com>
# Add application code
ADD . /app
# Prepare application (cache gems & precompile assets)
RUN cd /app && \
bundle package --all && \
RAILS_ENV=assets bundle exec rake assets:precompile && \
rm -rf spec && \
mkdir /config
# Add default configuration files
ADD ./config/unicorn.conf.rb /config/unicorn.conf.rb
ADD ./config/settings.yml /config/settings.yml
# Working directory
WORKDIR /app
# Define Rails environment
ENV RAILS_ENV production
# Define Settings file path
ENV SETTINGS_PATH /config/settings.yml
# Define Docker Remote API
ENV DOCKER_URL unix:///var/run/docker.sock
# Command to run
ENTRYPOINT ["/app/bin/run.sh"]
CMD ["bundle", "exec", "unicorn", "-c", "/config/unicorn.conf.rb"]
# Expose listen port
EXPOSE 80
# Expose the configuration and logs directories
VOLUME ["/config", "/app/log", "/envdir"]