Docker Setup
This commit is contained in:
1
.code2lab.env
Normal file
1
.code2lab.env
Normal file
@@ -0,0 +1 @@
|
||||
RAILS_ENV=production
|
||||
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@@ -0,0 +1,2 @@
|
||||
.git
|
||||
.dockerignore
|
||||
12
Dockerfile
Normal file
12
Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
||||
FROM ruby:2.4.1
|
||||
RUN apt-get update -qq && apt-get install -y build-essential libmysqlclient-dev libcups2-dev libpq-dev nodejs
|
||||
RUN mkdir /sxrestaurant
|
||||
RUN mkdir -p /sxrestaurant/tmp/puma
|
||||
ENV RAILS_ENV production
|
||||
WORKDIR /sxrestaurant
|
||||
COPY Gemfile /sxrestaurant/Gemfile
|
||||
COPY Gemfile.lock /sxrestaurant/Gemfile.lock
|
||||
RUN bundle install --without development test
|
||||
RUN bundle exec rails assets:precompile
|
||||
COPY . /sxrestaurant
|
||||
|
||||
@@ -3,6 +3,8 @@ require_relative 'boot'
|
||||
require 'csv'
|
||||
require 'rails/all'
|
||||
# require 'iconv'
|
||||
require 'openssl'
|
||||
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
|
||||
|
||||
# Require the gems listed in Gemfile, including any gems
|
||||
# you've limited to :test, :development, or :production.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
application_path = '/home/superuser/Application/sxrestaurant'
|
||||
application_path="#{File.expand_path("../..", __FILE__)}"
|
||||
directory application_path
|
||||
environment ENV.fetch("RAILS_ENV") { "production" }
|
||||
#environment ENV.fetch("RAILS_ENV") { "production" }
|
||||
environment "production"
|
||||
pidfile "#{application_path}/tmp/puma/pid"
|
||||
state_path "#{application_path}/tmp/puma/state"
|
||||
stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"
|
||||
|
||||
31
docker-compose.yml
Normal file
31
docker-compose.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
version: '3'
|
||||
services:
|
||||
code2lab:
|
||||
build: .
|
||||
links:
|
||||
- redis
|
||||
command: bundle exec puma -C config/puma.rb
|
||||
volumes:
|
||||
- .:/sxrestaurant
|
||||
env_file:
|
||||
- .code2lab.env
|
||||
ports:
|
||||
- '8081:62158'
|
||||
environment:
|
||||
- REDIS_URL=redis://redis:6379/0
|
||||
sidekiq:
|
||||
build: .
|
||||
command: bundle exec sidekiq -C config/sidekiq.yml
|
||||
links:
|
||||
- redis
|
||||
volumes:
|
||||
- .:/sxrestaurant
|
||||
environment:
|
||||
- REDIS_URL=redis://redis:6379/0
|
||||
|
||||
redis:
|
||||
image: redis
|
||||
ports:
|
||||
- '6379:6379'
|
||||
volumes:
|
||||
- ../data/redis:/data
|
||||
Reference in New Issue
Block a user