|
@@ -1,9 +1,21 @@
|
|
|
-FROM node:12.18.3-buster
|
|
|
+FROM node:lts-alpine
|
|
|
|
|
|
+# install simple http server for serving static content
|
|
|
+RUN npm install -g http-server
|
|
|
+
|
|
|
+# make the 'app' folder the current working directory
|
|
|
+
|
|
|
+# copy both 'package.json' and 'package-lock.json' (if available)
|
|
|
COPY package*.json ./
|
|
|
-RUN npm install babel-loader
|
|
|
+
|
|
|
+# install project dependencies
|
|
|
RUN npm install
|
|
|
-RUN npm update
|
|
|
|
|
|
-EXPOSE 8081
|
|
|
-RUN npm run serve
|
|
|
+# copy project files and folders to the current working directory (i.e. 'app' folder)
|
|
|
+COPY . .
|
|
|
+
|
|
|
+# build app for production with minification
|
|
|
+RUN npm run build
|
|
|
+
|
|
|
+EXPOSE 8080
|
|
|
+CMD [ "http-server", "dist" ]
|