commit from production server
This commit is contained in:
@@ -1 +1,2 @@
|
|||||||
RAILS_ENV=production
|
RAILS_ENV=production
|
||||||
|
SERVER_MODE=cloud
|
||||||
|
|||||||
21
Dockerfile
21
Dockerfile
@@ -1,15 +1,20 @@
|
|||||||
FROM ruby:2.4.1
|
FROM ruby:2.5
|
||||||
RUN apt-get update -qq && apt-get install -y build-essential libmysqlclient-dev libcups2-dev libpq-dev nodejs
|
RUN apt-get update -qq && apt-get install -y build-essential libmariadb-dev libcups2-dev libpq-dev nodejs tzdata
|
||||||
RUN mkdir /sxrestaurant
|
RUN mkdir /sxrestaurant
|
||||||
RUN mkdir -p /sxrestaurant/tmp/puma
|
RUN mkdir -p /sxrestaurant/tmp/puma
|
||||||
ENV RAILS_ENV staging
|
ENV RAILS_ENV production
|
||||||
ENV RACK_ENV staging
|
ENV RACK_ENV production
|
||||||
WORKDIR /sxrestaurant
|
WORKDIR /sxrestaurant
|
||||||
COPY Gemfile /sxrestaurant/Gemfile
|
#RUN gem install bundler
|
||||||
COPY Gemfile.lock /sxrestaurant/Gemfile.lock
|
#COPY Gemfile /sxrestaurant/Gemfile
|
||||||
RUN bundle install --without development test
|
#COPY Gemfile.lock /sxrestaurant/Gemfile.lock
|
||||||
|
#RUN bundle install --without development test
|
||||||
RUN echo "Asia/Rangoon" > /etc/timezone
|
RUN echo "Asia/Rangoon" > /etc/timezone
|
||||||
RUN dpkg-reconfigure -f noninteractive tzdata
|
RUN dpkg-reconfigure -f noninteractive tzdata
|
||||||
|
RUN date
|
||||||
COPY . /sxrestaurant
|
COPY . /sxrestaurant
|
||||||
|
RUN gem install bundler
|
||||||
|
#RUN bundle update --bundler
|
||||||
|
RUN bundle install --without development test
|
||||||
RUN bundle exec rake assets:precompile
|
RUN bundle exec rake assets:precompile
|
||||||
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]
|
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]
|
||||||
|
|||||||
19
Dockerfile.backup
Normal file
19
Dockerfile.backup
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
FROM ruby:2.5
|
||||||
|
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
|
||||||
|
ENV RACK_ENV production
|
||||||
|
WORKDIR /sxrestaurant
|
||||||
|
#RUN gem install bundler
|
||||||
|
#COPY Gemfile /sxrestaurant/Gemfile
|
||||||
|
#COPY Gemfile.lock /sxrestaurant/Gemfile.lock
|
||||||
|
#RUN bundle install --without development test
|
||||||
|
RUN echo "Asia/Rangoon" > /etc/timezone
|
||||||
|
RUN dpkg-reconfigure -f noninteractive tzdata
|
||||||
|
COPY . /sxrestaurant
|
||||||
|
RUN gem install bundler
|
||||||
|
#RUN bundle update --bundler
|
||||||
|
RUN bundle install --without development test
|
||||||
|
RUN bundle exec rake assets:precompile
|
||||||
|
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]
|
||||||
3
Gemfile
3
Gemfile
@@ -1,5 +1,6 @@
|
|||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
ruby '2.3.1'
|
#ruby '2.4.1'
|
||||||
|
ruby '2.5.7'
|
||||||
git_source(:github) do |repo_name|
|
git_source(:github) do |repo_name|
|
||||||
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
|
||||||
"https://github.com/#{repo_name}.git"
|
"https://github.com/#{repo_name}.git"
|
||||||
|
|||||||
33
Gemfile.lock
33
Gemfile.lock
@@ -62,7 +62,7 @@ GEM
|
|||||||
builder (3.2.3)
|
builder (3.2.3)
|
||||||
byebug (11.0.1)
|
byebug (11.0.1)
|
||||||
cancancan (1.17.0)
|
cancancan (1.17.0)
|
||||||
capistrano (3.10.1)
|
capistrano (3.11.2)
|
||||||
airbrussh (>= 1.0.0)
|
airbrussh (>= 1.0.0)
|
||||||
i18n
|
i18n
|
||||||
rake (>= 10.0.0)
|
rake (>= 10.0.0)
|
||||||
@@ -99,8 +99,8 @@ GEM
|
|||||||
factory_girl_rails (4.9.0)
|
factory_girl_rails (4.9.0)
|
||||||
factory_girl (~> 4.9.0)
|
factory_girl (~> 4.9.0)
|
||||||
railties (>= 3.0.0)
|
railties (>= 3.0.0)
|
||||||
faker (2.5.0)
|
faker (2.6.0)
|
||||||
i18n (~> 1.6.0)
|
i18n (>= 1.6, < 1.8)
|
||||||
ffi (1.11.1)
|
ffi (1.11.1)
|
||||||
filterrific (5.2.1)
|
filterrific (5.2.1)
|
||||||
font-awesome-rails (4.7.0.5)
|
font-awesome-rails (4.7.0.5)
|
||||||
@@ -140,7 +140,7 @@ GEM
|
|||||||
listen (3.0.8)
|
listen (3.0.8)
|
||||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||||
rb-inotify (~> 0.9, >= 0.9.7)
|
rb-inotify (~> 0.9, >= 0.9.7)
|
||||||
loofah (2.3.0)
|
loofah (2.3.1)
|
||||||
crass (~> 1.0.2)
|
crass (~> 1.0.2)
|
||||||
nokogiri (>= 1.5.9)
|
nokogiri (>= 1.5.9)
|
||||||
mail (2.7.1)
|
mail (2.7.1)
|
||||||
@@ -223,23 +223,23 @@ GEM
|
|||||||
chunky_png (~> 1.0)
|
chunky_png (~> 1.0)
|
||||||
rqrcode_core (~> 0.1.0)
|
rqrcode_core (~> 0.1.0)
|
||||||
rqrcode_core (0.1.0)
|
rqrcode_core (0.1.0)
|
||||||
rspec-core (3.8.2)
|
rspec-core (3.9.0)
|
||||||
rspec-support (~> 3.8.0)
|
rspec-support (~> 3.9.0)
|
||||||
rspec-expectations (3.8.5)
|
rspec-expectations (3.9.0)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.8.0)
|
rspec-support (~> 3.9.0)
|
||||||
rspec-mocks (3.8.2)
|
rspec-mocks (3.9.0)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.9.0)
|
rspec-support (~> 3.9.0)
|
||||||
rspec-rails (3.9.0)
|
rspec-rails (3.9.0)
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
railties (>= 3.0)
|
railties (>= 3.0)
|
||||||
rspec-core (~> 3.8.0)
|
rspec-core (~> 3.9.0)
|
||||||
rspec-expectations (~> 3.8.0)
|
rspec-expectations (~> 3.9.0)
|
||||||
rspec-mocks (~> 3.8.0)
|
rspec-mocks (~> 3.9.0)
|
||||||
rspec-support (~> 3.8.0)
|
rspec-support (~> 3.9.0)
|
||||||
rspec-support (3.8.3)
|
rspec-support (3.9.0)
|
||||||
ruby-ole (1.2.12.2)
|
ruby-ole (1.2.12.2)
|
||||||
rubyzip (1.0.0)
|
rubyzip (1.0.0)
|
||||||
sass (3.7.4)
|
sass (3.7.4)
|
||||||
@@ -267,8 +267,7 @@ GEM
|
|||||||
activemodel (>= 5.0)
|
activemodel (>= 5.0)
|
||||||
spreadsheet (1.2.4)
|
spreadsheet (1.2.4)
|
||||||
ruby-ole (>= 1.0)
|
ruby-ole (>= 1.0)
|
||||||
spring (2.0.2)
|
spring (2.1.0)
|
||||||
activesupport (>= 4.2)
|
|
||||||
spring-watcher-listen (2.0.1)
|
spring-watcher-listen (2.0.1)
|
||||||
listen (>= 2.7, < 4.0)
|
listen (>= 2.7, < 4.0)
|
||||||
spring (>= 1.2, < 3.0)
|
spring (>= 1.2, < 3.0)
|
||||||
@@ -371,7 +370,7 @@ DEPENDENCIES
|
|||||||
whenever
|
whenever
|
||||||
|
|
||||||
RUBY VERSION
|
RUBY VERSION
|
||||||
ruby 2.3.1p112
|
ruby 2.4.1p111
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.0.2
|
2.0.2
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ class Origami::DashboardController < BaseOrigamiController
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
@shop = Shop.first
|
@shop = Shop.first
|
||||||
|
Rails.logger.info ENV["SERVER_MODE"]
|
||||||
|
Rails.logger.info "<><><><><><><><>>"
|
||||||
today = DateTime.now.strftime('%Y-%m-%d')
|
today = DateTime.now.strftime('%Y-%m-%d')
|
||||||
|
|
||||||
@display_type = Lookup.find_by_lookup_type("display_type")
|
@display_type = Lookup.find_by_lookup_type("display_type")
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class Origami::PendingOrderController < BaseOrigamiController
|
|||||||
else
|
else
|
||||||
redirect_to "/origami/#{params[:type]}" and return
|
redirect_to "/origami/#{params[:type]}" and return
|
||||||
end
|
end
|
||||||
elsif id.start_with?("BKI")
|
elsif (id.start_with?("BKI")|| id.start_with?("CBKI"))
|
||||||
@bookings = Booking.find(id)
|
@bookings = Booking.find(id)
|
||||||
@order = @bookings.orders.where(status: "new").first
|
@order = @bookings.orders.where(status: "new").first
|
||||||
@order_items = @bookings.order_items
|
@order_items = @bookings.order_items
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ class License
|
|||||||
|
|
||||||
def initialize(server = "", lookup = "")
|
def initialize(server = "", lookup = "")
|
||||||
#this code is hard-code to reflect server mode - Very important.
|
#this code is hard-code to reflect server mode - Very important.
|
||||||
self.server_mode = ENV["SERVER_MODE"]
|
# self.server_mode = ENV["SERVER_MODE"]
|
||||||
|
self.server_mode = "cloud"
|
||||||
|
|
||||||
if (server != "")
|
if (server != "")
|
||||||
self.class.base_uri server
|
self.class.base_uri server
|
||||||
@@ -41,11 +42,12 @@ class License
|
|||||||
@params = { query: { lookup_type: self.server_mode, lookup: lookup, iv_key: aes_iv} }
|
@params = { query: { lookup_type: self.server_mode, lookup: lookup, iv_key: aes_iv} }
|
||||||
response = self.class.get("/subdomain", @params)
|
response = self.class.get("/subdomain", @params)
|
||||||
@license = response.parsed_response
|
@license = response.parsed_response
|
||||||
|
Rails.logger.info "License Response - " + response.parsed_response.to_s
|
||||||
|
|
||||||
if (@license["status"] == true)
|
if (@license["status"] == true)
|
||||||
assign(aes_key, aes_iv)
|
assign(aes_key, aes_iv)
|
||||||
|
|
||||||
# Rails.logger.info "License - " + response.parsed_response.to_s
|
#Rails.logger.info "License - " + response.parsed_response.to_s
|
||||||
|
|
||||||
redis = Redis.new
|
redis = Redis.new
|
||||||
redis.set(cache_key, Marshal.dump(@license))
|
redis.set(cache_key, Marshal.dump(@license))
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
require 'net/http'
|
require 'net/http'
|
||||||
require 'cups'
|
#require 'cups'
|
||||||
|
|
||||||
class Printer::PrinterWorker
|
class Printer::PrinterWorker
|
||||||
attr_accessor :print_settings
|
attr_accessor :print_settings
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
|
|
||||||
<div class="form-inputs p-l-25">
|
<div class="form-inputs p-l-25">
|
||||||
<%= f.input :name,:input_html=>{:class=>"col-md-9"} %>
|
<%= f.input :name,:input_html=>{:class=>"col-md-9"} %>
|
||||||
<%= f.input :is_active,:input_html=>{:class=>"col-md-9"} %>
|
<%= f.input :is_active,:input_html=>{:class=>"col-md-9"}, as: :boolean %>
|
||||||
<%= f.input :is_ordering,:input_html=>{:class=>"col-md-9"} %>
|
<%= f.input :is_ordering,:input_html=>{:class=>"col-md-9"}, as: :boolean %>
|
||||||
<div class="row checkboxes ">
|
<div class="row checkboxes ">
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<label class="control-label"><abbr title="required">*</abbr> Valid Day</label>
|
<label class="control-label"><abbr title="required">*</abbr> Valid Day</label>
|
||||||
|
|||||||
BIN
config/.database.yml.swp
Normal file
BIN
config/.database.yml.swp
Normal file
Binary file not shown.
@@ -1,7 +1,7 @@
|
|||||||
redis: &redis
|
redis: &redis
|
||||||
adapter: redis
|
adapter: redis
|
||||||
url: redis://localhost:6379/1
|
url: redis://172.17.0.1:6380/1
|
||||||
|
|
||||||
production: *redis
|
production: *redis
|
||||||
development: *redis
|
development: *redis
|
||||||
test: *redis
|
test: *redis
|
||||||
|
|||||||
@@ -3,4 +3,6 @@ if File.exist?("config/license.yml")
|
|||||||
config.fetch(Rails.env, {}).each do |key, value|
|
config.fetch(Rails.env, {}).each do |key, value|
|
||||||
ENV[key.upcase] = value.to_s
|
ENV[key.upcase] = value.to_s
|
||||||
end
|
end
|
||||||
end
|
else
|
||||||
|
ENV["SERVER_MODE"] = "cloud"
|
||||||
|
end
|
||||||
|
|||||||
@@ -9,5 +9,5 @@ test:
|
|||||||
<<: *default
|
<<: *default
|
||||||
|
|
||||||
production:
|
production:
|
||||||
<<: *default
|
db: 0
|
||||||
url: redis://127.0.0.1:6379
|
url: redis://172.17.0.1:6380
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ test:
|
|||||||
# instead read values from the environment.
|
# instead read values from the environment.
|
||||||
production:
|
production:
|
||||||
secret_key_base: c4bc81065013f9a3506d385bcbd49586c42e586488144b0de90c7da36867de9fa880f46b5c4f86f0ce9b7c783bb5a73bdb0e5605a47716567294390e726d3e22
|
secret_key_base: c4bc81065013f9a3506d385bcbd49586c42e586488144b0de90c7da36867de9fa880f46b5c4f86f0ce9b7c783bb5a73bdb0e5605a47716567294390e726d3e22
|
||||||
sx_provision_url: connect.smartsales.asia/api #192.168.1.147:3002/api
|
sx_provision_url: 52.221.188.144:9292/api #connect.smartsales.asia/api #192.168.1.147:3002/api
|
||||||
server_mode: application
|
server_mode: cloud
|
||||||
cipher_type: AES-256-CBC
|
cipher_type: AES-256-CBC
|
||||||
sx_key: Wh@t1$C2L
|
sx_key: Wh@t1$C2L
|
||||||
|
|||||||
1022
config/shops.json
1022
config/shops.json
File diff suppressed because it is too large
Load Diff
@@ -1,31 +1,33 @@
|
|||||||
version: '3'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
code2lab:
|
code2lab:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: ./Dockerfile
|
dockerfile: ./Dockerfile
|
||||||
links:
|
links:
|
||||||
- redis
|
- redis
|
||||||
volumes:
|
volumes:
|
||||||
- .:/sxrestaurant
|
- .:/sxrestaurant
|
||||||
env_file:
|
- "/etc/timezone:/etc/timezone:ro"
|
||||||
- .code2lab.env
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
ports:
|
env_file:
|
||||||
- '8082:62158'
|
- .code2lab.env
|
||||||
environment:
|
ports:
|
||||||
- REDIS_URL=redis://redis:6379/0
|
- '62160:62158'
|
||||||
sidekiq:
|
environment:
|
||||||
build: .
|
- REDIS_URL=redis://172.17.0.1:6380/0
|
||||||
command: bundle exec sidekiq -C config/sidekiq.yml
|
sidekiq:
|
||||||
links:
|
build: .
|
||||||
- redis
|
command: bundle exec sidekiq -C config/sidekiq.yml
|
||||||
volumes:
|
links:
|
||||||
- .:/sxrestaurant
|
- redis
|
||||||
environment:
|
volumes:
|
||||||
- REDIS_URL=redis://redis:6379/0
|
- .:/sxrestaurant
|
||||||
redis:
|
environment:
|
||||||
image: redis
|
- REDIS_URL=redis://172.17.0.1:6380/0
|
||||||
ports:
|
redis:
|
||||||
- '6380:6379'
|
image: redis
|
||||||
volumes:
|
ports:
|
||||||
- ../data/redis:/data
|
- '6380:6379'
|
||||||
|
volumes:
|
||||||
|
- ../data/redis:/data
|
||||||
|
|||||||
31
docker-compose.yml.back
Normal file
31
docker-compose.yml.back
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
code2lab:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: ./Dockerfile
|
||||||
|
links:
|
||||||
|
- redis
|
||||||
|
volumes:
|
||||||
|
- .:/sxrestaurant
|
||||||
|
env_file:
|
||||||
|
- .code2lab.env
|
||||||
|
ports:
|
||||||
|
- '8082: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:
|
||||||
|
- '6380:6379'
|
||||||
|
volumes:
|
||||||
|
- ../data/redis:/data
|
||||||
Reference in New Issue
Block a user