Dockerize. #5

This commit is contained in:
Koen Kanters
2018-04-26 19:37:07 +02:00
parent c3ca0249c4
commit 975bc741e2
5 changed files with 41 additions and 20 deletions
+13
View File
@@ -0,0 +1,13 @@
FROM node:9
# Copy files
ADD . /app
RUN cp /app/data/configuration.yaml /app
RUN cp /app/docker/start.sh /app
RUN chmod +x /app/start.sh
WORKDIR /app
RUN npm install
# Entrypoint
ENTRYPOINT ["./start.sh"]
-16
View File
@@ -1,16 +0,0 @@
FROM arm32v7/node
# Copy files
ADD . /app
RUN cp /app/data/configuration.yaml /app
# Create startup script.
RUN echo '#!/bin/bash\n\
cp -n /app/configuration.yaml /app/data/configuration.yaml\n\
npm start\n'\
>> /app/start.sh
RUN chmod +x /app/start.sh
WORKDIR /app
RUN npm install
ENTRYPOINT ["./start.sh"]
-4
View File
@@ -1,4 +0,0 @@
#!/bin/bash
docker build -t koenkk/zigbee2mqtt:arm32v7 -f Dockerfile ../../
docker push koenkk/zigbee2mqtt:arm32v7
+24
View File
@@ -0,0 +1,24 @@
FROM resin/armv7hf-debian
RUN [ "cross-build-start" ]
# Install nodejs and git
RUN curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
RUN apt-get update && apt-get install -y git nodejs make g++ && rm -rf /var/lib/apt/lists/*
# Copy files
ADD . /app
RUN cp /app/data/configuration.yaml /app
RUN cp /app/docker/start.sh /app
RUN chmod +x /app/start.sh
WORKDIR /app
RUN npm install
# Cleanup
RUN apt-get purge g++ make && apt-get autoremove && rm -rf /var/lib/apt/lists/*
RUN [ "cross-build-end" ]
# Entrypoint
ENTRYPOINT ["./start.sh"]
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
cp -n /app/configuration.yaml /app/data/configuration.yaml
npm start