-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
pedro-rodalia
committed
Jun 4, 2019
1 parent
26b4c27
commit 5bbbdd7
Showing
1 changed file
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |