-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (32 loc) · 1.2 KB
/
Copy pathDockerfile
File metadata and controls
43 lines (32 loc) · 1.2 KB
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
FROM phusion/passenger-ruby24:latest
# Use baseimage-docker's init process.
CMD ["/sbin/my_init"]
# Enable Nginx / Passenger
RUN rm -f /etc/service/nginx/down
# Install nginx config files
RUN rm /etc/nginx/sites-enabled/default
ADD docker/nginx_server.conf /etc/nginx/sites-enabled/spellsheet.conf
ADD docker/nginx_env.conf /etc/nginx/main.d/env.conf
# Add DB Migration Script
RUN mkdir -p /etc/my_init.d
ADD docker/db_migrate.sh /etc/my_init.d/db_migrate.sh
RUN chmod +x /etc/my_init.d/db_migrate.sh
# Set Default RAILS_ENV
ENV PASSENGER_APP_ENV docker
# Setup directory and install gems
RUN mkdir -p /home/app/spellsheet/
COPY Gemfile /home/app/spellsheet/
COPY Gemfile.lock /home/app/spellsheet/
RUN cd /home/app/spellsheet/ && bundle install --deployment
# Copy the app into the image
COPY . /home/app/spellsheet/
WORKDIR /home/app/spellsheet/
# Set log permissions
RUN mkdir -p /home/app/spellsheet/log
RUN chmod 0777 /home/app/spellsheet/log
# Compile assets
RUN env RAILS_ENV=production bundle exec rake assets:clobber assets:precompile
# Set ownership of the tmp folder
RUN chown -R app:app /home/app/spellsheet/tmp
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*