Skip to content
Next Next commit
Initial Docker Setup
  • Loading branch information
michael-misshore committed Dec 29, 2017
commit a5db88c5184872f73d0bb632b6a57f310b969d0b
1 change: 0 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ AllCops:
- 'spec/*_helper.rb'
- 'Gemfile'
- 'Rakefile'
- 'Vagrantfile'

Documentation:
Enabled: false
29 changes: 29 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: '2'
services:
ruby:
build:
context: .
dockerfile: docker/ruby/Dockerfile
volumes:
- .:/app:rw
volumes_from:
- data
depends_on:
- postgres
env_file: docker/ruby/.env
container_name: criticalpathcss_ruby

postgres:
image: postgres:10.1
ports:
- 5432:5432
volumes_from:
- data
env_file: ./docker/postgres/config

data:
image: postgres:10.1
volumes:
- /var/lib/postgresql/data
- /gems
command: "true"
2 changes: 2 additions & 0 deletions docker/postgres/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
POSTGRES_PASSWORD=docker
POSTGRES_USER=docker
6 changes: 6 additions & 0 deletions docker/ruby/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
RAILS_ENV=development
DATABASE_HOST=postgres
DATABASE_NAME=critical_path_css_development
DATABASE_USERNAME=docker
DATABASE_PASSWORD=docker
DATABASE_TEST_NAME=critical_path_css_test
18 changes: 18 additions & 0 deletions docker/ruby/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM ruby:2.5.0

# Install Dependencies
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get update && apt-get install -y build-essential libpq-dev nodejs npm

RUN npm cache clean -f
RUN npm install -g n
RUN n 8.9.3
RUN ln -sf /usr/local/n/versions/node/8.9.3/bin/node /usr/bin/nodejs

ENV BUNDLE_PATH /gems

WORKDIR /app

COPY docker/ruby/startup.dev /usr/local/bin/startup
RUN chmod 755 /usr/local/bin/startup
CMD "/usr/local/bin/startup"
5 changes: 5 additions & 0 deletions docker/ruby/startup.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

bundle check || bundle install

tail -f /dev/null