FitTrackee/mpwo_client/Dockerfile

28 lines
528 B
Docker
Raw Normal View History

2018-01-14 17:19:02 +01:00
FROM node:9.4.0
MAINTAINER SamR1
2018-01-07 22:10:25 +01:00
# set working directory
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
# add `/usr/src/app/node_modules/.bin` to $PATH
2018-01-14 12:48:52 +01:00
ENV PATH /usr/src/app/node_modules/.bin:$PATH
2018-01-07 22:10:25 +01:00
# add environment variables
2018-01-14 12:48:52 +01:00
ARG REACT_APP_API_URL
2018-01-07 22:10:25 +01:00
ARG NODE_ENV
ENV NODE_ENV $NODE_ENV
2018-01-14 12:48:52 +01:00
ENV REACT_APP_API_URL $REACT_APP_API_URL
2018-01-07 22:10:25 +01:00
# install and cache app dependencies
2018-01-14 17:19:02 +01:00
COPY package.json /usr/src/app/package.json
2018-01-14 12:48:52 +01:00
RUN yarn install --silent
RUN yarn global add react-scripts
2018-01-07 22:10:25 +01:00
# add app
2018-01-14 17:19:02 +01:00
COPY . /usr/src/app/
2018-01-07 22:10:25 +01:00
# start app
2018-01-14 12:48:52 +01:00
CMD yarn start