Dockerfile 2.5 KB

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