Skip to content

Commit a5db88c

Browse files
Initial Docker Setup
1 parent c5e0ebc commit a5db88c

File tree

6 files changed

+60
-1
lines changed

6 files changed

+60
-1
lines changed

.rubocop.yml

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ AllCops:
66
- 'spec/*_helper.rb'
77
- 'Gemfile'
88
- 'Rakefile'
9-
- 'Vagrantfile'
109

1110
Documentation:
1211
Enabled: false

docker-compose.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: '2'
2+
services:
3+
ruby:
4+
build:
5+
context: .
6+
dockerfile: docker/ruby/Dockerfile
7+
volumes:
8+
- .:/app:rw
9+
volumes_from:
10+
- data
11+
depends_on:
12+
- postgres
13+
env_file: docker/ruby/.env
14+
container_name: criticalpathcss_ruby
15+
16+
postgres:
17+
image: postgres:10.1
18+
ports:
19+
- 5432:5432
20+
volumes_from:
21+
- data
22+
env_file: ./docker/postgres/config
23+
24+
data:
25+
image: postgres:10.1
26+
volumes:
27+
- /var/lib/postgresql/data
28+
- /gems
29+
command: "true"

docker/postgres/config

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
POSTGRES_PASSWORD=docker
2+
POSTGRES_USER=docker

docker/ruby/.env

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
RAILS_ENV=development
2+
DATABASE_HOST=postgres
3+
DATABASE_NAME=critical_path_css_development
4+
DATABASE_USERNAME=docker
5+
DATABASE_PASSWORD=docker
6+
DATABASE_TEST_NAME=critical_path_css_test

docker/ruby/Dockerfile

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM ruby:2.5.0
2+
3+
# Install Dependencies
4+
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
5+
RUN apt-get update && apt-get install -y build-essential libpq-dev nodejs npm
6+
7+
RUN npm cache clean -f
8+
RUN npm install -g n
9+
RUN n 8.9.3
10+
RUN ln -sf /usr/local/n/versions/node/8.9.3/bin/node /usr/bin/nodejs
11+
12+
ENV BUNDLE_PATH /gems
13+
14+
WORKDIR /app
15+
16+
COPY docker/ruby/startup.dev /usr/local/bin/startup
17+
RUN chmod 755 /usr/local/bin/startup
18+
CMD "/usr/local/bin/startup"

docker/ruby/startup.dev

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
bundle check || bundle install
4+
5+
tail -f /dev/null

0 commit comments

Comments
 (0)