mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Merge pull request #846 from bastilimbach/develop
Add the ability to use the docker image with a raspberry pi
This commit is contained in:
commit
f45bd18cc2
@ -5,6 +5,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
## [2.1.2] - Unreleased
|
## [2.1.2] - Unreleased
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
- Change Docker base image (Debian + Node) to an arm based distro (AlpineARM + Node) ([#846](https://github.com/MichMich/MagicMirror/pull/846))
|
||||||
- Fix the dockerfile to have it running from the first time.
|
- Fix the dockerfile to have it running from the first time.
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
31
Dockerfile
31
Dockerfile
@ -1,22 +1,27 @@
|
|||||||
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 .. \
|
|
||||||
&& dos2unix docker-entrypoint.sh \
|
# Convert docker-entrypoint.sh to unix format and grant execution privileges
|
||||||
&& chmod +x docker-entrypoint.sh
|
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
|
||||||
|
|
||||||
EXPOSE $MM_PORT
|
EXPOSE $MM_PORT
|
||||||
ENTRYPOINT ["/opt/magic_mirror/docker-entrypoint.sh"]
|
ENTRYPOINT ["/opt/magic_mirror/docker-entrypoint.sh"]
|
||||||
|
@ -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** |
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/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 -Rn /opt/magic_mirror/unmount_modules/. /opt/magic_mirror/modules
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f /opt/magic_mirror/config ]; then
|
if [ ! -f /opt/magic_mirror/config ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user