Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Example Docker setup #77

Open
c-lliope opened this issue Jan 31, 2017 · 2 comments
Open

Example Docker setup #77

c-lliope opened this issue Jan 31, 2017 · 2 comments

Comments

@c-lliope
Copy link

c-lliope commented Jan 31, 2017

I wanted to provide my setup with webkit-rails and Docker – if possible, it would be nice to add some of this to the README.

Sample docker-compose.yml file. Note the -b and --host options, which expose the server processes to the host machine.

services:
  webpack:
    env_file: .env
    image: assemble/web
    command: /app/node_modules/.bin/webpack-dev-server --config config/webpack.config.js --host 0.0.0.0
    volumes:
      - .:/app
    ports:
      - 8888:8888

  web:
    build: .
    command: bundle exec rails s -p 3000 -b 0.0.0.0
    ports:
      - "$PORT:3000"
    links:
      - db
      - webpack
    volumes:
      - .:/app

Be sure to set the manifest_host to match the name of the docker-compose webpack service.

# config/application.rb
    config.webpack.dev_server.manifest_host = 'webpack'
    config.webpack.dev_server.manifest_port = 3808
    config.webpack.dev_server.port = 3808

When webpack runs inside a Docker container, it cannot observe the file change events that it needs to re-compile the assets. As a workaround, add to your webpack config:

// config/webkit.config.js
  watchOptions: {
    poll: true
  }
@bpinto
Copy link

bpinto commented Feb 1, 2017

When webpack runs inside a Docker container, it cannot observe the file change events that it needs to re-compile the assets. As a workaround, add to your webpack config:

@Graysonwright Are you on OS X? I think this is a limitation of docker for mac but not of docker itself as I've been running webpack on docker for a few months now and I don't need that setting.

@c-lliope
Copy link
Author

ah, I think you're right. IIRC, it's an issue with Virtualbox so it affects users running Docker on OS X and Windows.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants