arg
ARG
example
Dockerfile
```dockerfile
FROM daocloud.io/library/node:6.1.0
ARG app_env ENV APP_ENV $app_env
Set workspace
ENV REACT_ROOT /www/crms RUN mkdir -p $REACT_ROOT WORKDIR $REACT_ROOT
ADD docker_run.sh .
COPY example.env.production.local example.env.production.local
COPY example.env.preproduction.local example.env.preproduction.local
RUN /bin/bash docker_run.sh
RUN if [ ${APP_ENV} = production ]; then cp example.env.production.local .env.production.local else cp example.env.preproduction.local .env.preproduction.local fi
Install app dependencies
COPY package.json package.json RUN npm install
Bundle app source
COPY . .
Build and optimize react app
RUN npm run build --production
run react
EXPOSE 5000 RUN npm install -g serve CMD serve -s build
Last updated