Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #601 from ain/feature/docker-compose
Update Docker Compose to v3
- Loading branch information
Showing
3 changed files
with
39 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: {} |