Dockerfile 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. FROM debian:9
  2. EXPOSE 8000
  3. #RUN echo "Acquire::http::Proxy \"http://172.17.0.5:3142\";" | tee /etc/apt/apt.conf.d/00aptproxy
  4. RUN apt-get update
  5. RUN apt-get install -yq git wget vim tmux php-cli php-mysql php-curl graphviz php-amqplib php7.0-xml php7.0-zip
  6. RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
  7. RUN php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
  8. RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer
  9. RUN php -r "unlink('composer-setup.php');"
  10. ADD . /opt/ftth
  11. RUN mkdir ~/.ssh
  12. RUN ssh-keyscan -H bitbucket.org >> ~/.ssh/known_hosts
  13. RUN ssh-keyscan -H -p 222 infra.flowdat.com >> ~/.ssh/known_hosts
  14. RUN ssh-keyscan -H -p 222 200.50.168.30 >> ~/.ssh/known_hosts
  15. RUN ssh-keyscan -H -p 222 infra.flowdat.com >> ~/.ssh/known_hosts
  16. WORKDIR /opt/ftth
  17. RUN chmod 0600 keys/*
  18. RUN rm -rf /opt/ftth/vendor/*
  19. RUN rm -f app/config/parameters.yml
  20. RUN rm -f app/config/url_webservice.yml
  21. RUN rm -f app/config/hwioauthbundle/parameters.yml
  22. RUN cp app/config/parameters.yml.docker app/config/parameters.yml
  23. RUN cp app/config/url_webservice.yml.docker app/config/url_webservice.yml
  24. RUN cp app/config/hwioauthbundle/parameters.yml.docker app/config/hwioauthbundle/parameters.yml
  25. RUN cp app/config/bundles/ik/device-bundle/parameters.yml.docker app/config/bundles/ik/device-bundle/parameters.yml
  26. RUN rm -rf /opt/ftth/app/config/parameters.yml /opt/ftth/app/config/url_webservice.yml
  27. RUN cp -r keys /opt/keys/
  28. RUN chmod 0600 /opt/keys/*
  29. RUN eval $(ssh-agent) ; ssh-add /opt/keys/bitbucket.id_rsa ; composer install --no-scripts --no-interaction
  30. CMD eval $(ssh-agent) ; ssh-add /opt/keys/bitbucket.id_rsa ; composer install --no-scripts --no-interaction ;\
  31. rm var/cache/* -rf ;\
  32. cp app/config/parameters.yml.docker app/config/parameters.yml ;\
  33. cp app/config/url_webservice.yml.docker app/config/url_webservice.yml ;\
  34. cp app/config/hwioauthbundle/parameters.yml.docker app/config/hwioauthbundle/parameters.yml ;\
  35. cp app/config/bundles/ik/device-bundle/parameters.yml.docker app/config/bundles/ik/device-bundle/parameters.yml ;\
  36. composer dump-autoload ;\
  37. composer run-script symfony-scripts --no-interaction ;\
  38. cat app/config/hwioauthbundle/parameters.yml ; bin/console server:run 0.0.0.0 --env=dev