Using the base image I always create a docker image that includes all plugins I use. Recently I have added something to fix the timezone in there:
RUN ln -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime
I prefer the solution above however…
Here is my complete dockerfile, for reference
FROM joshendriks/raspberry-pi2-pimatic:4
RUN ln -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime
# Install pimatic modules
RUN cd /home/pimatic-app && npm install --unsafe-perm mysql pimatic-homeduino pimatic-mqtt@0.9.6 pimatic-ds18b20 pimatic-node-red pimatic-smartmeter-gas pimatic-tplink-smartplug
RUN cd /home/pimatic-app && npm install node-red-node-pushbullet
RUN cd /home/pimatic-app && npm install node-red-node-smooth
RUN cd /home/pimatic-app && npm install node-red-contrib-stoptimer
RUN cd /home/pimatic-app && npm install node-red-contrib-http-request
RUN cd /home/pimatic-app && npm install node-red-contrib-influxdb
RUN cd /home/pimatic-app && npm install node-red-node-ping
COPY config.master.json /home/pimatic-app/config.json
# Run pimatic once so that all coffeescripts are built and npm packages are downloaded and built
## Make sure that pimatic will exit when startup is completed
RUN cp /home/pimatic-app/node_modules/pimatic/startup.coffee /home/pimatic-app/node_modules/pimatic/startup.backup
RUN sed -i "s/initComplete = true/framework.destroy().then( -> exit(0) )/g" /home/pimatic-app/node_modules/pimatic/startup.coffee
## Run pimatic
RUN cd / && pimatic.js
## Restore startup.coffee and remove it from compiled cache
RUN rm /home/pimatic-app/node_modules/pimatic/startup.coffee \
&& mv /home/pimatic-app/node_modules/pimatic/startup.backup /home/pimatic-app/node_modules/pimatic/startup.coffee \
&& rm /home/pimatic-app/node_modules/pimatic/.js/startup.*
# Run pimatic.js at start of the container
ENTRYPOINT ["pimatic.js"]
EXPOSE 80 8000
Every now and then I blog about pimatic at http://www.hendriks.software/tag/pimatic