Dockerfile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 \
  12. mariadb-server
  13. RUN \
  14. apt-get install -y libswitch-perl libdate-calc-perl
  15. RUN \
  16. useradd -m bus && \
  17. echo 'bus:bus' | chpasswd
  18. RUN \
  19. su bus -c " cd /home/bus && \
  20. git clone https://tree.clementinecomputing.com/clementinecomputing/popufare && \
  21. mkdir -p /home/bus/.ssh && chmod 0700 /home/bus/.ssh && \
  22. mkdir -p /home/bus/bin && \
  23. mkdir -p /home/bus/data && \
  24. sqlite3 /home/bus/data/bus.sqlite < /home/bus/popufare/server/sql_schema/create_tables.sqlite && \
  25. sqlite3 /home/bus/data/bus.sqlite < /home/bus/popufare/server/testing/db/setup-testdb.sqlite "
  26. COPY setup-testdb /root/setup-testdb
  27. RUN bash /root/setup-testdb
  28. # service mysql start && \
  29. # bash -c 'mysql < <( echo -e "create database busdb;\ncreate user bus;\ngrant all privileges on busdb.* to \'bus\'@\'%\';\nflush privileges;\n" ) ' && \
  30. # su bus -c " cd /home/bus && \
  31. # mysql -u bus busdb < popufare/server/create_tables.sql && \
  32. # mysql -u bus busdb < popufare/server/testing/db/setup-testdb.sql "
  33. ## setup test ssh access
  34. ##
  35. ## WARNING: this MUST be changed for anything other than testing purposes
  36. ##
  37. COPY ./snakeoil_id_rsa.pub /home/bus/.ssh/authorized_keys.snakeoil
  38. RUN su bus -c \
  39. " cat /home/bus/.ssh/authorized_keys.snakeoil >> /home/bus/.ssh/authorized_keys && \
  40. chmod 640 /home/bus/.ssh/authorized_keys "
  41. # non-essential but helpful for debuggin/admin
  42. #
  43. RUN \
  44. apt-get install -y vim
  45. # main startup scripts
  46. #
  47. COPY ./startup_and_persist.sh /root/startup_and_persist.sh
  48. RUN \
  49. chmod u+x /root/startup_and_persist.sh
  50. EXPOSE 80 22 443 6055 2857 7277 2455 3556 8377
  51. CMD ["/root/startup_and_persist.sh"]