Testing meteor inside docker container - slow to start


#1

I am using the meteord scripts as a basis for my docker file but trying to run my tests inside of a docker container rather than do a build. My docker file is looking like this:

FROM ubuntu:trusty
MAINTAINER Ben Hernandez <ben@flowhub.co>

COPY scripts $METEORD_DIR

# Setup
RUN bash $METEORD_DIR/lib/install_base.sh
RUN bash $METEORD_DIR/lib/cleanup.sh
RUN bash $METEORD_DIR/lib/install_meteor.sh
RUN npm install -g spacejam

# Copies the app over
COPY pos /opt/app
WORKDIR /opt/app
COPY test_settings.json /opt/app/test_settings.json

# Run the tests
RUN npm install
RUN meteor npm install
RUN spacejam test --once --driver-package practicalmeteor:mocha-console-runner --settings test_settings.json`

Everything is going great, (and starts super fast) but it takes forever to run that last command, like starting meteor is a 10 minute process. Happens much faster on a computer that has already started the app once (even in a docker container). Are there any files/folders than I could cache from the first go-around that would make the second startup happen much faster?


#2

did you look at https://markshust.com creating a custom production image for meteor ?