Skip to content

Commit

Permalink
Dockerfile updated
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-rodalia committed Jun 4, 2019
1 parent 26b4c27 commit 5bbbdd7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 5bbbdd7

Please sign in to comment.