I am trying to run simple Rails app using docker.
Source code taken from data container 'app'. The 'app' data container also used by nginx to server precompiled assets and static files.
But no precompiled assets found after running 'bundle exec rake assets:precompile'.
I am using docker on Mac OS X with VirtualBox (Docker version 1.10.1, build 9e83765).
docker-compose.yml
version: '2'
services:
web:
build: .
command: bundle exec puma
env_file: .env
environment:
- RACK_ENV=production
- RAILS_ENV=production
volumes_from:
- app
ports:
- "3000:3000"
links:
- db
nginx:
image: nginx
ports:
- "80:80"
volumes_from:
- app
volumes:
- /app/public:/usr/share/nginx/html:ro
- /app/config/deploy/nginx.conf:/etc/nginx/conf.d/default.conf
db:
image: postgres
env_file: .env
volumes_from:
- data
app:
image: busybox
volumes:
- /myapp/app:/app:rw
data:
image: busybox
volumes:
- /myapp/data:/var/lib/postgresql/data
Dockerfile
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
WORKDIR /app
ADD . /app
RUN gem install bundler && bundle install --jobs 20 --retry 5 --without development test && rake assets:precompile
VOLUME /app/public
I tried also without 'VOLUME /app/public'
Please advice what can be the issue.
Thanks.