Change linux distribution

I changed the linux distribution from node, which used Debian, to an arm based linux distribution so the application can be used on an arm based system (e.g. Raspberry)
This commit is contained in:
Sebastian Limbach 2017-04-12 20:19:24 +02:00
parent eae21e1371
commit d5e902679b
No known key found for this signature in database
GPG Key ID: B4E66C247054F17B
3 changed files with 20 additions and 15 deletions

View File

@ -1,20 +1,25 @@
FROM node:latest FROM izone/arm:node
# Set env variables
ENV NODE_ENV production ENV NODE_ENV production
ENV MM_PORT 8080 ENV MM_PORT 8080
WORKDIR /opt/magic_mirror WORKDIR /opt/magic_mirror
COPY . . # Cache node_modules
COPY /modules unmount_modules COPY package.json /opt/magic_mirror
COPY /config unmount_config RUN npm install
RUN apt-get update \ # Copy all needed files
&& apt-get -qy install tofrodos dos2unix \ COPY . /opt/magic_mirror
&& chmod -R 777 vendor \
&& npm install \ # Save/Cache config and modules folder for docker-entrypoint
&& cd vendor \ COPY /modules /opt/magic_mirror/unmount_modules
&& npm install \ COPY /config /opt/magic_mirror/unmount_config
&& cd .. \
# 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 \ && dos2unix docker-entrypoint.sh \
&& chmod +x docker-entrypoint.sh && chmod +x docker-entrypoint.sh

View File

@ -59,7 +59,7 @@ docker run -d \
--volume ~/magic_mirror/config:/opt/magic_mirror/config \ --volume ~/magic_mirror/config:/opt/magic_mirror/config \
--volume ~/magic_mirror/modules:/opt/magic_mirror/modules \ --volume ~/magic_mirror/modules:/opt/magic_mirror/modules \
--name magic_mirror \ --name magic_mirror \
MichMich/MagicMirror michmich/magicmirror
``` ```
| **Volumes** | **Description** | | **Volumes** | **Description** |

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/sh
if [ ! -f /opt/magic_mirror/modules ]; then if [ ! -f /opt/magic_mirror/modules ]; then
cp -R /opt/magic_mirror/unmount_modules/. /opt/magic_mirror/modules cp -R /opt/magic_mirror/unmount_modules/. /opt/magic_mirror/modules