Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM xqdocker/ubuntu-ruby-2.0

RUN apt-get update && \
apt-get install -y nodejs build-essential libpq-dev sqlite3 libsqlite3-dev --no-install-recommends && \
rm -rf /var/lib/apt/lists/* && \
echo "user:x:1000:1000:user:/:/sbin/nologin" >> /etc/passwd

WORKDIR /app

COPY Gemfile Gemfile
COPY Gemfile.lock Gemfile.lock

RUN bundle config build.nokogiri --use-system-libraries && \
bundle install --jobs=3 --retry=3

COPY . /app

EXPOSE 3000

RUN chown -R user /app

USER user

CMD ["rails", "server", "-b", "0.0.0.0"]
4 changes: 2 additions & 2 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
Bundler.require(:default, :assets, Rails.env)
end

module Labtool
Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
config.action_controller.perform_caching = true

# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
config.serve_static_assets = true

# Compress JavaScripts and CSS
config.assets.compress = true
Expand Down
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: "3.2"
services:
web:
build: .
command: rails s --binding 0.0.0.0
ports:
- "3000:3000"
environment:
- RAILS_ENV=production
stdin_open: true
tty: true