Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Docker Compose to v3 #601

Merged
merged 4 commits into from
Apr 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions .docker/nginx/sites-enabled/ffcrm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
server {
listen 80;
server_name ffcrm.dev;
root /home/app/public;
passenger_enabled on;
passenger_user app;
passenger_ruby /usr/bin/ruby2.4;
}
30 changes: 14 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
# fig build
# fig run web bundle exec rake db:create db:schema:load ffcrm:demo:load
# fig up
# Usage:
# docker-compose up
# docker-compose exec web bundle exec rake db:create db:schema:load ffcrm:demo:load assets:precompile

FROM phusion/passenger-ruby24
MAINTAINER Steve Kenworthy

RUN apt-get update \
&& apt-get install -y sudo \
&& apt-get autoremove -y

ENV HOME /root

CMD ["/sbin/my_init"]
ENV HOME /home/app

ADD . /home/app/ffcrm
WORKDIR /home/app/ffcrm
ADD . /home/app
WORKDIR /home/app

RUN cp config/database.postgres.docker.yml config/database.yml

RUN chown -R app:app /home/app/ffcrm
RUN sudo -u app bundle install --deployment
RUN apt-get update \
&& apt-get install -y imagemagick firefox \
&& apt-get autoremove -y \
&& cp config/database.postgres.docker.yml config/database.yml \
&& chown -R app:app /home/app \
&& rm -f /etc/service/nginx/down /etc/nginx/sites-enabled/default \
&& cp .docker/nginx/sites-enabled/ffcrm.conf /etc/nginx/sites-enabled/ffcrm.conf \
&& bundle install --deployment
30 changes: 17 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
web:
build: .
user: app
command: "bundle exec rails server"
links:
- db
ports:
- "3000:3000"

db:
image: postgres
ports:
- "5432"
version: '3'
services:
web:
build: .
links:
- db
ports:
- "80:80"
volumes:
- gems:/usr/local/rvm/gems
environment:
RAILS_ENV: 'production'
PASSENGER_APP_ENV: 'production'
db:
image: postgres:9.5
volumes:
gems: {}