Browse Source

use Alpine Linux to reduce image size

Davide Alberani 9 months ago
parent
commit
05ef1a3843
1 changed files with 7 additions and 7 deletions
  1. 7 7
      Dockerfile

+ 7 - 7
Dockerfile

@@ -1,4 +1,4 @@
-FROM node
+FROM alpine
 LABEL \
 	maintainer="Davide Alberani <da@erlug.linux.it>" \
 	vendor="RaspiBO"
@@ -6,12 +6,12 @@ LABEL \
 EXPOSE 3000
 
 RUN \
-	apt-get update && \
-	apt-get -y --no-install-recommends install \
+	apk add --no-cache \
 		nodejs \
-		python3-pymongo \
-		python3-tornado && \
-	rm -rf /var/lib/apt/lists/*
+		npm \
+		py3-pip \
+		py3-tornado && \
+	pip3 install pymongo
 
 COPY . /ibt2
 
@@ -19,7 +19,7 @@ WORKDIR /ibt2/
 
 RUN \
 	npm install && \
-	nodejs build/build.js && \
+	node build/build.js && \
 	rm -rf node_modules
 
 ENTRYPOINT ["./ibt2.py", "--mongo_url=mongodb://mongo", "--debug"]