Dockerfile 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. FROM docker.infra.flowdat.com/fd3/sf-php:latest
  2. EXPOSE 80/tcp 22
  3. ENV DEBIAN_FRONTEND noninteractive
  4. ENV NOTVISIBLE "in users profile"
  5. COPY ./execute.sh /opt/
  6. COPY . /etc/supervisord
  7. COPY var/ /var/log/supervisor/
  8. COPY sshd_config /etc/ssh/sshd_config
  9. COPY .ssh/config /root/.ssh/config
  10. COPY cron.d/fd3_stats /etc/cron.d/fd3_stats
  11. COPY script.sh /opt/script.sh
  12. ADD bin/* /usr/bin/
  13. WORKDIR /opt
  14. RUN chmod +x /opt/execute.sh; \
  15. chmod 0600 /opt/keys/*; \
  16. eval $(ssh-agent); \
  17. ssh-add /opt/keys/bitbucket.id_rsa; \
  18. echo Acquire::http::Proxy "http://aptcache.infra.flowdat.com/"; > /etc/apt/apt.conf.d/00aptproxy; \
  19. apt-get update; \
  20. apt-get install -yq parallel lockfile-progs expect telnet sudo cron patch \
  21. openssh-server gdal-bin; \
  22. pip install supervisor paramiko argparse; \
  23. mkdir -p /var/log/supervisor/; \
  24. mkdir /var/run/sshd; \
  25. sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd; \
  26. echo "export VISIBLE=now" >> /etc/profile; \
  27. mkdir /etc/ssh/keys/; \
  28. chmod 400 /root/.ssh/config; \
  29. cp keys/bitbucket.id_rsa.pub /etc/ssh/keys/authorized_keys; \
  30. cp keys/bitbucket.id_rsa /etc/ssh/keys/bitbucket.id_rsa; \
  31. chmod 0600 /etc/ssh/keys; \
  32. chmod 0600 /etc/ssh/keys/authorized_keys; \
  33. chown root:root -R /etc/ssh/keys; \
  34. chmod 0644 /etc/cron.d/fd3_stats; \
  35. /usr/bin/crontab /etc/cron.d/fd3_stats; \
  36. touch /var/log/cron.log; \
  37. touch /var/log/cron.err.log; \
  38. touch /var/log/cron.out.log; \
  39. git clone https://ikdrone:Flowdat3@gitlab.com/interlink-sa/flowdat3/modules/stats.git /opt/stats; \
  40. cd /opt/stats; \
  41. cp app/config/parameters.yml.dist app/config/parameters.yml ;\
  42. cp app/config/bundles/hwi/oauth-bundle/parameters.yml.dist app/config/bundles/hwi/oauth-bundle/parameters.yml ;\
  43. cp app/config/bundles/ik/webservice-bundle/parameters.yml.dist app/config/bundles/ik/webservice-bundle/parameters.yml ;\
  44. cp app/config/bundles/ik/base-admin-bundle/parameters.yml.dist app/config/bundles/ik/base-admin-bundle/parameters.yml; \
  45. cp app/config/bundles/ik/audit-bundle/parameters.yml.dist ./app/config/bundles/ik/audit-bundle/parameters.yml; \
  46. eval $(ssh-agent); ssh-add /opt/keys/bitbucket.id_rsa; \
  47. composer install --no-scripts --no-interaction --no-progress; \
  48. cd /opt; \
  49. chmod +x /opt/script.sh; \
  50. rm /etc/apt/apt.conf.d/00aptproxy; \
  51. rm -rf /var/lib/apt/lists/*
  52. ENTRYPOINT ["/opt/execute.sh"]