Commit b04e76f6 authored by Nathaniel Suchy's avatar Nathaniel Suchy

Add Docker Support

parent 5792f81d
......@@ -28,6 +28,9 @@
# macOS
.DS_Store
# data
/postgres
# Editors
.vscode
.idea
\ No newline at end of file
FROM ruby:2.6.2
RUN apt-get update -qq && apt-get install -y nodejs postgresql-client
RUN mkdir /app
WORKDIR /app
COPY Gemfile /app/Gemfile
COPY Gemfile.lock /app/Gemfile.lock
RUN gem install bundler
RUN bundle install
COPY . /app
# Add a script to be executed every time the container starts.
COPY entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
EXPOSE 3000
# Start the main process.
CMD ["rails", "server", "-b", "0.0.0.0"]
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.5.3'
ruby '2.6.2'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2'
gem 'rails', '~> 5.2.2.1'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
......
......@@ -52,8 +52,8 @@ GEM
bootsnap (1.4.1)
msgpack (~> 1.0)
builder (3.2.3)
byebug (11.0.0)
capybara (3.14.0)
byebug (11.0.1)
capybara (3.15.0)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
......@@ -63,7 +63,7 @@ GEM
xpath (~> 3.2)
childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11)
chromedriver-helper (2.1.0)
chromedriver-helper (2.1.1)
archive-zip (~> 0.10)
nokogiri (~> 1.8)
coffee-rails (4.2.2)
......@@ -108,11 +108,11 @@ GEM
msgpack (1.2.9)
multi_json (1.13.1)
nio4r (2.3.1)
nokogiri (1.10.1)
nokogiri (1.10.2)
mini_portile2 (~> 2.4.0)
pg (1.1.4)
public_suffix (3.0.3)
puma (3.12.0)
puma (3.12.1)
rack (2.0.6)
rack-test (1.1.0)
rack (>= 1.0, < 3)
......@@ -209,7 +209,7 @@ DEPENDENCIES
mini_racer
pg (>= 0.18, < 2.0)
puma (~> 3.12)
rails (~> 5.2)
rails (~> 5.2.2.1)
sass-rails (~> 5.0)
selenium-webdriver
spring
......@@ -220,7 +220,7 @@ DEPENDENCIES
web-console (>= 3.3.0)
RUBY VERSION
ruby 2.5.3p105
ruby 2.6.2p47
BUNDLED WITH
2.0.1
P+g45xBuZoqdoVuYZrBaDoqMJDj/shMBtQg65LmO3RTYQNHb7ffrwr2+avtcktBqGBa/r7E3WFpAM9weBbO/oXnXjhzhzvIFtOS3kio4fUCwvUGmKfN1qgojI0Xt5AnuK8gfC7avrU2Zk71bgaaMbQvJSvyZZ+f11MDlaE2RttSwvTYdneXpSr3iQXC33mwth/8JhWiJ/vtwW6sb08hQvVAvbJeToqU2ak60IcwZ5THv54Ldw5vTU9RfxD2grbK1LxxxlhxNOfNBvftTEe5uavpd84sOs6biPAAG/Kn5TKjbwA+GioyMlj6d66zPFOkAoJ5ig7CL6lOfGrK06VtgQMLreCApbsHoEIw/Pj6dAixR9srfZy53XkUu8VQ8pWrboFYWW02DHTvcnnCkH7QVYQ1Kocai7SJXuiit--3M31Jnp2SNWmQ00q--Bszv74Oia6ngLmwcWY3S8A==
\ No newline at end of file
SOFU6XvSI2jJ7x/JHFe380VaI9dzpKiOUaXud+sWGcs+1xrqsR5WXThe5C0cwjP5EEEdtMEDYZUxBNcT8z+E1p2/I4D0ExB5wlpoXQH3aFVIDKfiKs3xdY1Sj//r6gtDe/Jh7TBEvXCrBd/sTGgrzdV0y8l6kXpuS9ys0OGM/G0L6mHXXOKtlULV9Wj99Bu+8R1zXwTgLxMWxeyP/WvqxUu5NtloF+f/VRVWfGvMoMhXjXWd2Q4mz/nb+MDI2crSi+1X4iHS5suNHhA6g09Ho83jZq4YTiJeSVMd71JWvDfUtUqYKkXbVEga2TVEEzDDilyHqSwjb9LJhG4tYr/m9TTj4ii6eDOyp/omFoVyyIASK6vW+jcTAHzWHG8NOOiUwcqp0FrY+BV9H9Dm/Pks9KO+HgMsEMyVQgjR--YXVlh7dG2X4E2zLj--idnuWL8Gy2H9HXmj+2oXXQ==
\ No newline at end of file
# PostgreSQL. Versions 9.1 and up are supported.
#
# Install the pg driver:
# gem install pg
# On OS X with Homebrew:
# gem install pg -- --with-pg-config=/usr/local/bin/pg_config
# On OS X with MacPorts:
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
# On Windows:
# gem install pg
# Choose the win32 build.
# Install PostgreSQL and put its /bin directory on your path.
#
# Configure Using Gemfile
# gem 'pg'
#
default: &default
adapter: postgresql
encoding: unicode
# For details on connection pooling, see Rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
host: db
username: postgres
password:
pool: 5
development:
production:
<<: *default
database: webapp_development
# The specified database role being used to connect to postgres.
# To create additional roles in postgres see `$ createuser --help`.
# When left blank, postgres will use the default role. This is
# the same name as the operating system user that initialized the database.
#username: postgres
# The password associated with the postgres role (username).
#password:
# Connect on a TCP socket. Omitted by default since the client uses a
# domain socket that doesn't need configuration. Windows does not have
# domain sockets, so uncomment these lines.
#host: localhost
# The TCP port the server listens on. Defaults to 5432.
# If your server runs on a different port number, change accordingly.
#port: 5432
database: app_production
# Schema search path. The server defaults to $user,public
#schema_search_path: myapp,sharedapp,public
development:
<<: *default
database: app_development
# Minimum log levels, in increasing order:
# debug5, debug4, debug3, debug2, debug1,
# log, notice, warning, error, fatal, and panic
# Defaults to warning.
#min_messages: notice
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: webapp_test
# As with config/secrets.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is
# ever seen by anyone, they now have access to your database.
#
# Instead, provide the password as a unix environment variable when you boot
# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
# for a full rundown on how to provide these environment variables in a
# production deployment.
#
# On Heroku and other platform providers, you may have a full connection URL
# available as an environment variable. For example:
#
# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
#
# You can use this database configuration with:
#
# production:
# url: <%= ENV['DATABASE_URL'] %>
#
production:
<<: *default
url: <%= ENV['DATABASE_URL'] %>
database: app_test
......@@ -20,14 +20,14 @@ Rails.application.configure do
# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
#config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
config.assets.compile = true
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
......
version: '3'
services:
db:
image: postgres
volumes:
- ./tmp/db:/var/lib/postgresql/data
web:
build: .
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0' -e production"
depends_on:
- db
volumes:
- ./:/app
ports:
- "127.0.0.1:3000:3000"
depends_on:
- db
#!/bin/bash
set -e
# Remove a potentially pre-existing server.pid for Rails.
rm -f /app/tmp/pids/server.pid
# Then exec the container's main process (what's set as CMD in the Dockerfile).
exec "$@"
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment