Sha256: 00f9210139faf24c814509f080b8d5ad5545e066bb35c7d98c64d99e5a04d834
Contents?: true
Size: 1 KB
Versions: 6
Compression:
Stored size: 1 KB
Contents
# Docker To setup webpacker with a dockerized Rails application is trivial. First, add a new service for webpacker in docker-compose.yml: ```Dockerfile version: '3' services: webpacker: build: . env_file: - '.env.docker' command: bundle exec webpack-dev-server volumes: - .:/webpacker-example-app ports: - '3035:3035' ``` add nodejs and yarn as dependencies in Dockerfile, ```dockerfile FROM ruby:2.4.1 RUN apt-get update -qq RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - RUN curl -sL https://deb.nodesource.com/setup_8.x | bash RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list RUN apt-get install -y nodejs RUN apt-get update && apt-get install yarn # Rest of the commands.... ``` and create an env file to load environment variables from: ```env NODE_ENV=development RAILS_ENV=development WEBPACKER_DEV_SERVER_HOST: 0.0.0.0 ``` Lastly, rebuild your container: ```bash docker-compose up --build ```
Version data entries
6 entries across 6 versions & 2 rubygems