2017-01-10 8 views
1

docker 개발 환경에서 레일과 함께 사용할 때 문지르 기와 함께 문제가 발생했습니다. README의 모든 단계를 따라 기존 모델에 이미지를 추가하면 오류가 없지만 이미지가 로컬로 업로드되지 않습니다. S3에 직접 업로드하려고했는데 동일한 문제가 발생하지 않았으며 이미지가 누락 된 폴더가 비어 있습니까?docker의 클립으로 이미지가 업로드되지 않습니까?

내 코드는 깨끗합니다. 부두 밖으로 시도해 보았습니다. 어떤 제안이든 작동합니까?

나는 캐리어 웨이브를 사용해 보았지만 잘 작동하지만 클립 클립을 사용하는 것이 더 가볍고 강력하다는 것을 알았습니다. 버전 레일, 부두 노동자 이미지, 루비 버전 등 :

+0

당신이 우리에게 당신의 설정에 대한 자세한 내용을 말할 수이를 사용해야 내 Dockerfile입니다 ... 당신이 우리에게 단서를주지 않으면 도움을주기가 꽤 어려움 –

+0

답장을 보내 주셔서 감사합니다. 부두 이미지는 루비 2.3.1- 슬림, 레일 5.0.1입니다. 실제로 풀 루비 2.3.1로 도커 이미지를 변경하여 빠른 해결책을 찾았는데 트릭을 만들었습니다. 문제는 슬림 이미지에 클립이 처리해야하는 일부 종속성이 누락되었습니다. 실제 문제가 무엇인지에 대해 알고 있다면 도움이 될 것입니다. –

+0

나는 또한 ruby ​​slim을 사용하여'imagemagick'과'file' 의존성을 추가했습니다. imagemagick은 mime 형식을 결정하기 위해 내부적으로 file 명령을 사용하기 때문에. – Chris

답변

1

이것은

# Use the barebones version of Ruby 2.3. 
FROM ruby:2.3.1-slim 

# Optionally set a maintainer name to let people know who made this image. 
MAINTAINER Chris de Bruin <[email protected]> 

# Install dependencies: 
# - build-essential: To ensure certain gems can be compiled 
# - nodejs: Compile assets 
# - imagemagick: converting images 
# - file: needed by paperclip 
# - wkhtmltopdf: generating pdf from html 
# - libxml2: needed for nokogiri 
RUN apt-get update && apt-get install -qq -y --no-install-recommends \ 
     build-essential libmysqlclient-dev git-core imagemagick wkhtmltopdf \ 
     libxml2 libxml2-dev libxslt1-dev nodejs file 

# Set an environment variable to store where the app is installed to inside 
# of the Docker image. The name matches the project name out of convention only. 
ENV INSTALL_PATH /backend 
RUN mkdir -p $INSTALL_PATH 

# This sets the context of where commands will be ran in and is documented 
# on Docker's website extensively. 
WORKDIR $INSTALL_PATH 

# Ensure gems are cached and only get updated when they change. This will 
# drastically increase build times when your gems do not change. 
COPY Gemfile Gemfile 
COPY Gemfile.lock Gemfile.lock 

RUN bundle install 

# Copy in the application code from your work station at the current directory 
# over to the working directory. 
COPY . . 

# Ensure the static assets are exposed through a volume so that nginx can read 
# in these values later. 
VOLUME ["$INSTALL_PATH/public"] 

# The default command that gets ran will be to start the Puma server. 
CMD bundle exec puma -C config/puma.rb 

그래서 당신이 당신의 자신의 Dockerfile을하고 docker-compose.yml

+0

크리스, 감사합니다.). –