Dockerfile 681 B

1234567891011121314
  1. FROM nginx:alpine
  2. MAINTAINER wuyunfeng
  3. RUN mkdir -p /app/
  4. COPY ./dist /app/
  5. COPY ./nginx.conf /etc/nginx/nginx.conf
  6. EXPOSE 443 80
  7. ENV serverUrl=http://172.28.100.100:8005 DeviceUrl=http://172.28.100.100:8006 apiMode=dev uiVersion=1
  8. RUN echo 'USERNAME=' $serverUrl ',DeviceUrl=' $DeviceUrl ',apiMode=' $apiMode ',uiVersion=' $uiVersion
  9. #CMD sh -c "sed -i 's/^.*8006.*$/serverUrl=$serverUrl' domain.js"
  10. CMD sh -c "sed -i -e \"s~^.*serverUrl.*$~serverUrl:'$serverUrl',~;s~^.*DeviceUrl.*$~DeviceUrl:'$DeviceUrl',~;s~^.*apiMode.*$~apiMode:'$apiMode',~;s~^.*uiVersion.*$~uiVersion:$uiVersion~\" /app/domain.js; exec nginx -g \"daemon off;\""
  11. #CMD sh -c "exec nginx -g 'daemon off;'"