Приложение-докер Refinery CMS, имеющее проблемы с записью в файловую систему хоста в Windows 10 - PullRequest
0 голосов
/ 29 мая 2019

В настоящее время я экспериментирую с CMS на нефтеперерабатывающем заводе в качестве опции для веб-сайта моей организации и пытаюсь установить его в док-контейнере. После создания сайта нефтеперерабатывающего завода и вставки файла dockerfile и файла docker-compose в корневой каталог проекта я могу контейнировать приложение. Однако после того, как я ввел начальную информацию о создании учетной записи, НПЗ выдает ошибку:

enter image description here

Я попытался пробиться в контейнер и изменить разрешения для каталога безрезультатно. В любом случае это не должно иметь значения. Все в контейнере запускается от имени root. На стороне Windows весь код хранится в моем домашнем каталоге, с которым у меня есть полный контроль.

Dockerfile

FROM ruby:2.5.3
RUN apt-get update && apt-get install -y build-essential libpq-dev 
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
        && apt-get install -y nodejs
RUN apt install imagemagick
RUN mkdir /myapp
WORKDIR /myapp
COPY Gemfile /myapp/Gemfile
COPY Gemfile.lock /myapp/Gemfile.lock
RUN bundle install
RUN rails active_storage:install
COPY . /myapp
RUN chmod -R 777 /myapp

докер-compose.yml

version: '3'
services:
 web:
  build: .
  command: bundle exec rails s -p 3000 -b '0.0.0.0'
  volumes:
   - .:/myapp
  ports:
   - "3000:3000"

Gemfile

source 'https://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.7'
# Use sqlite3 as the database for Active Record
group :development, :test do
  gem 'sqlite3'
end
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '>= 2.15'
  gem 'selenium-webdriver'
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

# Refinery CMS
gem 'refinerycms', '~> 4.0'

# Optionally, specify additional Refinery CMS Extensions here:
gem 'refinerycms-acts-as-indexed', ['~> 3.0', '>= 3.0.0']
gem 'refinerycms-wymeditor', ['~> 2.0', '>= 2.0.0']
gem 'refinerycms-authentication-devise', '~> 2.0'
#  gem 'refinerycms-blog', ['~> 4.0', '>= 4.0.0']
#  gem 'refinerycms-inquiries', ['~> 4.0', '>= 4.0.0']
#  gem 'refinerycms-search', ['~> 4.0', '>= 4.0.0']
#  gem 'refinerycms-page-images', ['~> 4.0', '>= 4.0.0']
...