| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- FROM debian:buster
- MAINTAINER Abram Connelly <abram@clementinecomputing.com>
- RUN \
- apt-get update && \
- apt-get -y upgrade && \
- apt-get clean
- RUN \
- apt-get install -y gcc perl \
- sudo \
- git openssh-server sqlite3 libdbd-sqlite3-perl \
- default-mysql-server apache2 \
- netcat telnet wget \
- python3-flask python3-pymysql python3-pip \
- mariadb-server
- RUN \
- apt-get install -y libswitch-perl libdate-calc-perl python3-bson python3-pymongo
- RUN \
- pip3 install flask-restful mysql-connector-python
- RUN \
- useradd -m bus && \
- echo 'bus:bus' | chpasswd && \
- echo 'root:bus' | chpasswd && \
- usermod -aG sudo bus
- RUN \
- su bus -c " cd /home/bus && \
- git clone https://tree.clementinecomputing.com/clementinecomputing/popufare && \
- mkdir -p /home/bus/.ssh && chmod 0700 /home/bus/.ssh && \
- mkdir -p /home/bus/bin && \
- mkdir -p /home/bus/data && \
- sqlite3 /home/bus/data/bus.sqlite < /home/bus/popufare/server/sql_schema/create_tables.sqlite && \
- sqlite3 /home/bus/data/bus.sqlite < /home/bus/popufare/server/testing/db/setup-testdb.sqlite "
- COPY setup-testdb /root/setup-testdb
- RUN bash /root/setup-testdb
- ## setup test ssh access
- ##
- ## WARNING: this MUST be changed for anything other than testing purposes
- ##
- COPY ./snakeoil_id_rsa.pub /home/bus/.ssh/authorized_keys.snakeoil
- RUN su bus -c \
- " cat /home/bus/.ssh/authorized_keys.snakeoil >> /home/bus/.ssh/authorized_keys && \
- chmod 640 /home/bus/.ssh/authorized_keys "
- # non-essential but helpful for debuggin/admin
- #
- RUN \
- apt-get install -y vim
- RUN \
- mkdir -p /etc/ridelogic && \
- mkdir -p /etc/ridelogic/logs && \
- mkdir -p /var/log/ridelogic && \
- mkdir -p /var/run/ridelogic && \
- cp -f /home/bus/popufare/server/install/etc/ridelogic/api.conf /etc/ridelogic && \
- cp -f /home/bus/popufare/server/install/etc/ridelogic/daemon.conf /etc/ridelogic && \
- cp -f /home/bus/popufare/server/scripts/RideLogic.pm /usr/share/perl5 && \
- cp -f /home/bus/popufare/server/scripts/RideLogicDBI.pm /usr/share/perl5 && \
- cp -f /home/bus/popufare/server/scripts/RideLogicACL.pm /usr/share/perl5 && \
- cp -f /home/bus/popufare/server/scripts/RideLogicAPIQueryWrapper.pm /usr/share/perl5 && \
- cp -f /home/bus/popufare/server/config/etc/mysql/mariadb.conf.d/50-server.cnf /etc/mysql/mariadb.conf.d/50-server.cnf
- # main startup scripts
- #
- COPY ./startup_and_persist.sh /root/startup_and_persist.sh
- RUN \
- chmod u+x /root/startup_and_persist.sh
- EXPOSE 80 22 443 6055 2857 7277 2455 3556 8377 5000
- CMD ["/root/startup_and_persist.sh"]
|