samedi 13 août 2016

Ember + Docker slow during transpilation

I'm attempting to Dockerize my local development setup to make it much simpler to onboard new developers. Part of my setup in an Ember application. I've followed the instructions at this repository, but am running into huge delays when the Ember app starts up. It gets to the point where it says Serving on http://localhost:4200 and then there's a significant delay (on the order of 10s of minutes) between that message and when you see the output where Ember CLI displays how long it takes to compile everything. That said, the compilation time displayed is only a few minutes.

My docker-compose.yml file:

version: '2'
services:
    nginx:
        container_name: 'nginx'
        image: jwilder/nginx-proxy
        volumes:
            - /var/run/docker.sock:/tmp/docker.sock:ro
        ports:
            - "80:80"
            - "443:443"

    frontend:
        container_name: 'frontend'
        env_file: .env
        depends_on:
            - nginx
            - api
        environment:
            - VIRTUAL_HOST=*.scout.dev
            - VIRTUAL_PORT=4200
        image: scoutforpets/ember-cli
        command: bash -c "npm i && GIT_DIR=/tmp bower i --allow-root && ember s --watcher polling"
        volumes:
            - ./app-business/:/app/
            - ./app-business/ssl/:/etc/nginx/certs/
        ports:
            - "4200:4200"       # Default Port
            - "49152:49152"     # Live Reload Port

    api:
        container_name: 'api'
        env_file: .env
        command: bash -c "npm i -s && npm run start-debug"
        image: node:6.3.1
        depends_on:
            - postgres
            - redis
        ports:
            - "3001:3001"       # Default Port
            - "9229:9229"       # Debug Port
        working_dir: /app/
        volumes:
            - ./api/:/app/

    postgres:
        container_name: 'postgres'
        image: scoutforpets/postgres
        ports:
            - "5432:5432"

    redis:
        container_name: 'redis'
        image: redis
        ports:
            - "6379:6379"

Note that my project is mounted from the file system (I'm running OSX Yosemite). I have heard some conversation around mounted file systems being slow, but am having trouble finding a definitive answer.

If someone is successfully using Ember + Docker, I'd love to hear what you're doing!

Thanks!




Aucun commentaire:

Enregistrer un commentaire