Dockerfile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. FROM debian:buster
  2. MAINTAINER Abram Connelly <abram@clementinecomputing.com>
  3. RUN \
  4. apt-get update && \
  5. apt-get -y upgrade && \
  6. apt-get clean
  7. RUN \
  8. apt-get install -y gcc perl \
  9. git openssh-server sqlite3 libdbd-sqlite3-perl \
  10. default-mysql-server apache2 \
  11. netcat telnet wget python3-flask python3-pymysql python3-pip \
  12. mariadb-server
  13. RUN \
  14. apt-get install -y libswitch-perl libdate-calc-perl bson python3-pymongo
  15. RUN \
  16. pip3 install flask-restful
  17. RUN \
  18. useradd -m bus && \
  19. echo 'bus:bus' | chpasswd
  20. RUN \
  21. su bus -c " cd /home/bus && \
  22. git clone https://tree.clementinecomputing.com/clementinecomputing/popufare && \
  23. mkdir -p /home/bus/.ssh && chmod 0700 /home/bus/.ssh && \
  24. mkdir -p /home/bus/bin && \
  25. mkdir -p /home/bus/data && \
  26. sqlite3 /home/bus/data/bus.sqlite < /home/bus/popufare/server/sql_schema/create_tables.sqlite && \
  27. sqlite3 /home/bus/data/bus.sqlite < /home/bus/popufare/server/testing/db/setup-testdb.sqlite "
  28. COPY setup-testdb /root/setup-testdb
  29. RUN bash /root/setup-testdb
  30. ## setup test ssh access
  31. ##
  32. ## WARNING: this MUST be changed for anything other than testing purposes
  33. ##
  34. COPY ./snakeoil_id_rsa.pub /home/bus/.ssh/authorized_keys.snakeoil
  35. RUN su bus -c \
  36. " cat /home/bus/.ssh/authorized_keys.snakeoil >> /home/bus/.ssh/authorized_keys && \
  37. chmod 640 /home/bus/.ssh/authorized_keys "
  38. # non-essential but helpful for debuggin/admin
  39. #
  40. RUN \
  41. apt-get install -y vim
  42. RUN \
  43. mkdir -p /etc/ridelogic && \
  44. mkdir -p /etc/ridelogic/logs && \
  45. mkdir -p /var/log/ridelogic && \
  46. mkdir -p /var/run/ridelogic && \
  47. cp -f /home/bus/popufare/server/install/etc/ridelogic/api.conf /etc/ridelogic && \
  48. cp -f /home/bus/popufare/server/install/etc/ridelogic/daemon.conf /etc/ridelogic && \
  49. cp -f /home/bus/popufare/server/scripts/RideLogic.pm /usr/share/perl5 && \
  50. cp -f /home/bus/popufare/server/scripts/RideLogicDBI.pm /usr/share/perl5 && \
  51. cp -f /home/bus/popufare/server/scripts/RideLogicACL.pm /usr/share/perl5 && \
  52. cp -f /home/bus/popufare/server/scripts/RideLogicAPIQueryWrapper.pm /usr/share/perl5
  53. # main startup scripts
  54. #
  55. COPY ./startup_and_persist.sh /root/startup_and_persist.sh
  56. RUN \
  57. chmod u+x /root/startup_and_persist.sh
  58. EXPOSE 80 22 443 6055 2857 7277 2455 3556 8377 5000
  59. CMD ["/root/startup_and_persist.sh"]