Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
app
bin
config
lib
log
public
tmp
vendor
.dockerignore
.gitignore
Dockerfile
Gemfile
Gemfile.lock
README.md
Rakefile
config.ru
package-lock.json
package.json
webpack.config.js

README.md

Simpacker Docker example

Dockerfile

FROM node:10-alpine as assets-builder
RUN mkdir -p /app
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install
COPY webpack.config.js ./
COPY app/javascript ./app/javascript
RUN NODE_ENV=production ./node_modules/.bin/webpack

FROM ruby:2.6
ENV RAILS_ENV production
ENV RAILS_SERVE_STATIC_FILES=1
RUN mkdir -p /app
WORKDIR /app
RUN gem install bundler -v 2.0.2
COPY Gemfile /app/Gemfile
COPY Gemfile.lock /app/Gemfile.lock
RUN bundle install -j4 --deployment --without 'development test'
COPY . /app
COPY --from=assets-builder /app/public/packs ./public/packs

CMD ["bundle", "exec", "rails", "server"]

Build and Run

$ docker build -t simpacker-example .
$ docker run --rm -it -p 3000:3000 -e RAILS_SERVE_STATIC_FILES=1 simpacker-example
You can’t perform that action at this time.