diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 7c13de7..0000000 --- a/Dockerfile +++ /dev/null @@ -1,70 +0,0 @@ -FROM ubuntu:22.04 - -VOLUME ["/var/www"] - -ENV TZ=Pacific/Auckland -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -# Using apt-get instead of apt to prevent warning about apt not having a stable CLI interface - -# Increment this to force an update of the apt deps -RUN echo 123 > /dev/null - -# Make all php versions other than the current main version (7.4) available -RUN apt-get update && apt-get install -y software-properties-common -RUN add-apt-repository -y ppa:ondrej/php -RUN add-apt-repository -y ppa:ondrej/apache2 - -# Set this arg so that apt-utils does not cause other warnings -ARG DEBIAN_FRONTEND=noninteractive - -# bcmath extension and chromium gave warnings when installing if this was missing -RUN apt-get install -y apt-utils - -RUN apt-get install -y apache2 - -RUN apt-get install -y libapache2-mod-php8.1 -RUN apt-get install -y php8.1 -RUN apt-get install -y php8.1-bcmath -RUN apt-get install -y php8.1-cli -RUN apt-get install -y php8.1-curl -RUN apt-get install -y php8.1-dev -RUN apt-get install -y php8.1-dom -RUN apt-get install -y php8.1-gd -RUN apt-get install -y php8.1-intl -RUN apt-get install -y php8.1-ldap -RUN apt-get install -y php8.1-mbstring -RUN apt-get install -y php8.1-mysql -RUN apt-get install -y php8.1-tidy -RUN apt-get install -y php8.1-xdebug -RUN apt-get install -y php8.1-zip - -# Install other packages -RUN apt-get install -y nano wget unzip jq - -# Increment echo to get a more recent version of chrome -RUN echo 1 > /dev/null - -COPY docker_apache_default /etc/apache2/sites-available/000-default.conf -RUN a2enmod rewrite - -EXPOSE 80 -EXPOSE 443 - -# Default www-data user/group id is 33, change it to 1000 to match the steve user on host -# https://jtreminio.com/blog/running-docker-containers-as-current-host-user/#ok-so-what-actually-works -ARG USER_ID=1000 -ARG GROUP_ID=1000 -RUN userdel -f www-data &&\ - if getent group www-data ; then groupdel www-data; fi &&\ - groupadd -g ${GROUP_ID} www-data &&\ - useradd -l -u ${USER_ID} -g www-data www-data &&\ - install -d -m 0755 -o www-data -g www-data /home/www-data &&\ - chown --changes --silent --no-dereference --recursive \ - --from=33:33 ${USER_ID}:${GROUP_ID} \ - /home/www-data - -# Docker script - anything else that's just easier to write in raw bash than dockerfile -COPY docker_script /usr/local/bin/docker_script -RUN chmod +x /usr/local/bin/docker_script -CMD ["/usr/local/bin/docker_script"] diff --git a/README.md b/README.md index b78eb7c..ee35e7d 100644 --- a/README.md +++ b/README.md @@ -8,28 +8,6 @@ Use the following querystring syntax to select a table and filter the results - `?t=merged-prs&filters={"authorType"%3A"!product%20%26%26%20!bot"}` -## Docker commands - -**Start containers** - -docker-compose up --build -d - -**Stop containers** - -docker-compose down - -**SSH in as root** - -docker exec -it rhino_webserver /bin/bash - -**SSH in as www-data user** - -docker exec -it rhino_webserver sh -c "cd /var/www && su -s /bin/bash www-data" - -## Log in to database from host - -`mysql -uroot -proot -h0.0.0.0 -P3398 -DSS_mysite` - ## GitHub API token Rhino is designed to only access public repos, therefore the GitHub API token should have zero permissions. The token is used purely to increase the allowed API rate limit. diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index a48bb10..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,43 +0,0 @@ -version: '3.8' - -services: - - webserver: - container_name: rhino_webserver - build: - context: . - volumes: - - ../rhino/:/var/www - domainname: rhino.test - hostname: www - networks: - mynet: - ipv4_address: 10.0.98.50 - - mariadb: - container_name: rhino_mariadb - image: mariadb:10.5.2 - volumes: - - mariadb-volume:/var/lib/mysql - environment: - TZ: "Pacific/Auckland" - MYSQL_ALLOW_EMPTY_PASSWORD: "yes" - MYSQL_ROOT_PASSWORD: "root" - MYSQL_DATABASE: 'SS_mysite' - ports: - - 3398:3306 - networks: - mynet: - -volumes: - mariadb-volume: - name: rhino_mariadb-volume - -networks: - mynet: - name: rhino_mynet - driver: bridge - ipam: - driver: default - config: - - subnet: 10.0.98.0/24 diff --git a/docker_apache_default b/docker_apache_default deleted file mode 100644 index a2cbd0c..0000000 --- a/docker_apache_default +++ /dev/null @@ -1,37 +0,0 @@ - -# The ServerName directive sets the request scheme, hostname and port that - # the server uses to identify itself. This is used when creating - # redirection URLs. In the context of virtual hosts, the ServerName - # specifies what hostname must appear in the request's Host: header to - # match this virtual host. For the default virtual host (this file) this - # value is not decisive as it is used as a last resort host regardless. - # However, you must set it for any further virtual host explicitly. - - ServerName rhino.test - - ServerAdmin webmaster@localhost - DocumentRoot /var/www - - - AllowOverride All - Require all granted - - - # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, - # error, crit, alert, emerg. - # It is also possible to configure the loglevel for particular - # modules, e.g. - #LogLevel info ssl:warn - - ErrorLog /dev/stdout - CustomLog /dev/stdout combined - - # For most configuration files from conf-available/, which are - # enabled or disabled at a global level, it is possible to - # include a line for only one particular virtual host. For example the - # following line enables the CGI configuration for this host only - # after it has been globally disabled with "a2disconf". - #Include conf-available/serve-cgi-bin.conf - - -# vim: syntax=apache ts=4 sw=4 sts=4 sr noet diff --git a/docker_script b/docker_script deleted file mode 100644 index ae5d6e6..0000000 --- a/docker_script +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -enable_xdebug=false - -# set -e -- Exit immediately if a command exits with a non-zero status. -set -e - -PHP_ERROR_REPORTING=${PHP_ERROR_REPORTING:-"E_ALL"} - -version="8.1" -types="apache2 cli" -# https://xdebug.org/docs/upgrade_guide -xdebug3_options="xdebug.mode xdebug.start_with_request xdebug.discover_client_host xdebug.client_host xdebug.client_port" - -# Configure: -# - Error reporting -# - Max upload filesize -for type in $types; do - path="/etc/php/$version/$type/php.ini" - if [[ -f "/etc/php/$version/$type/php.ini" ]]; then - sed -ri 's/^display_errors\s*=\s*Off/display_errors = On/g' "$path" - sed -ri "s/^error_reporting\s*=.*$//g" "$path" - echo "error_reporting = $PHP_ERROR_REPORTING" >> "$path" - echo "upload_max_filesize = 50M" >> "$path" - fi -done - -# Disable/enable loading xdebug extension -# We use this method because it gives the biggest performance increase, and because -# this will disable both apache2 and cli since their ini's are both symlinked to mods-available i.e. -# - /etc/php/8.1/apache2/conf.d/20-xdebug.ini -# - /etc/php/8.1/cli/conf.d/20-xdebug.ini -# Note: Disabling xdebug improves performance by 50% -path="/etc/php/$version/mods-available/xdebug.ini" -if [ -f "$path" ]; then - value=";zend_extension=xdebug.so" - if [ "$enable_xdebug" == true ]; then - value="zend_extension=xdebug.so" - fi - echo "$value" > "$path" -fi -# Set xdebug options in php.ini files -for type in $types; do - path="/etc/php/$version/$type/php.ini" - if [ -f "$path" ]; then - for option in $xdebug3_options; do - value="On" - if [[ "$option" == "xdebug.client_host" ]]; then - value="172.17.0.1" - fi - if [[ "$option" == "xdebug.mode" ]]; then - value="debug" - fi - if [[ "$option" == "xdebug.client_port" ]]; then - value="9000" - fi - if grep -r "$option" "$path" > /dev/null; then - sed -i "s/$option =.*/$option = $value/g" "$path" - else - echo "$option = $value" >> "$path" - fi - done - fi -done - -# Apache gets grumpy about PID files pre-existing, so remove them: -rm -f /var/run/apache2/apache2.pid - -# Read default envvars, which includes APACHE_RUN_USER/GROUP=www-data -source /etc/apache2/envvars - -# Start apache -# It seems like -DFOREGROUND is required for the container to work correctly -exec /usr/sbin/apache2 -DFOREGROUND