2017-04-12 20:19:24 +02:00
|
|
|
FROM izone/arm:node
|
2017-01-31 11:41:40 +01:00
|
|
|
|
2017-04-12 20:19:24 +02:00
|
|
|
# Set env variables
|
2017-04-04 18:30:24 +02:00
|
|
|
ENV NODE_ENV production
|
|
|
|
ENV MM_PORT 8080
|
2017-04-12 20:19:24 +02:00
|
|
|
|
2017-01-31 11:41:40 +01:00
|
|
|
WORKDIR /opt/magic_mirror
|
2017-04-04 18:30:24 +02:00
|
|
|
|
2017-04-12 20:19:24 +02:00
|
|
|
# Cache node_modules
|
|
|
|
COPY package.json /opt/magic_mirror
|
|
|
|
RUN npm install
|
|
|
|
|
|
|
|
# Copy all needed files
|
|
|
|
COPY . /opt/magic_mirror
|
|
|
|
|
|
|
|
# Save/Cache config and modules folder for docker-entrypoint
|
|
|
|
COPY /modules /opt/magic_mirror/unmount_modules
|
|
|
|
COPY /config /opt/magic_mirror/unmount_config
|
2017-01-31 11:41:40 +01:00
|
|
|
|
2017-04-12 20:19:24 +02:00
|
|
|
# Convert docker-entrypoint.sh to unix format and grant execution privileges
|
|
|
|
RUN apk update \
|
|
|
|
&& apk add dos2unix --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted \
|
|
|
|
&& dos2unix docker-entrypoint.sh \
|
|
|
|
&& chmod +x docker-entrypoint.sh
|
2017-01-31 11:41:40 +01:00
|
|
|
|
|
|
|
EXPOSE $MM_PORT
|
|
|
|
ENTRYPOINT ["/opt/magic_mirror/docker-entrypoint.sh"]
|