From 5bbbdd7cc1e185926e024477bc360645003b7256 Mon Sep 17 00:00:00 2001 From: pedro-rodalia Date: Tue, 4 Jun 2019 20:56:08 +0200 Subject: [PATCH] Dockerfile updated --- Dockerfile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index b80471b..491a832 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,20 @@ # Source image -FROM node +FROM node:10.15.0 +# Set the api url as an envieroment variable for the build process +ARG API_URL="http://localhost:4000/" +ENV API_URL=$API_URL # Set environment port and expose it ARG PORT=3000 ENV PORT=$PORT EXPOSE $PORT # Update npm to its latest version RUN npm i npm@latest -g -# Copy directory and install dependencies from the project +# Move to the home directory +WORKDIR /home/app +# Clone repository +RUN git clone --single-branch --branch master https://github.com/pedro-rodalia/iot-frontend.git +# Move to the directory and install dependencies from the project WORKDIR /home/app/iot-frontend -COPY package.json ./ -RUN npm install -# Copy the source code -COPY . . +RUN npm install && npm run build # Run the app CMD ["node", "./bin/www"]