├── Dockerfile ├── LICENSE ├── README.md ├── bin ├── osticket-install.php ├── update └── vendor ├── build ├── conf ├── msmtp └── supervisord └── docker-compose.yml /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM banian/php 2 | MAINTAINER Pooya Parsa 3 | 4 | # Install packages 5 | RUN apt-get update && \ 6 | apt-get install -yf cron && \ 7 | rm -rv /var/lib/apt 8 | 9 | # Set upsteam repo 10 | ENV GIT_REPO=https://github.com/osTicket/osTicket 11 | 12 | # Scripts 13 | COPY bin /bin 14 | COPY conf/supervisord /etc/supervisor/conf.d/osticket.conf 15 | COPY conf/msmtp /etc/msmtp.default 16 | 17 | # Conf files 18 | RUN touch /etc/msmtp /etc/osticket.secret.txt /etc/cron.d/osticket && \ 19 | chown www-data:www-data /etc/msmtp /etc/osticket.secret.txt /etc/cron.d/osticket && \ 20 | chown root:www-data /bin/vendor /bin/update && chmod 770 /bin/vendor /bin/update 21 | 22 | VOLUME /var/www 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Pooya Parsa 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [osTicket](http://osticket.com) Docker Image 2 | ============================================= 3 | [![Docker Pulls](https://img.shields.io/docker/pulls/osticket/osticket.svg)](https://hub.docker.com/r/osticket/osticket) 4 | 5 | 7 | 8 | Docker image for running always fresh and bleeding edge version of [osTicket](http://osticket.com/) Shipping with plugins and language packs. **osTicket** is a widely-used open source support ticket system. It seamlessly 9 | integrates inquiries created via email, phone and web-based forms into a 10 | simple easy-to-use multi-user web interface. Manage, organize and archive 11 | all your support requests and responses in one place while providing your 12 | customers with accountability and responsiveness they deserve. 13 | 14 | ## How osTicket works for you 15 | 1. Users create tickets via your website, email, or phone 16 | 2. Incoming tickets are saved and assigned to agents 17 | 3. Agents help your users resolve their issues 18 | 19 | osTicket is an attractive alternative to higher-cost and complex customer 20 | support systems; simple, lightweight, reliable, open source, web-based and 21 | easy to setup and use. The best part is, it's completely free. 22 | 23 | * Based on [PaaS](https://github.com/pi0/paas) Image. 24 | * Works with a linked Mariadb docker container. 25 | * Automates configuration file & database installation 26 | * Email support 27 | * Always have bleeding edge version 28 | * Stock plugins are always installed and updated 29 | 30 | # Quick Start 31 | 32 | Ensure you have a MySQL container running that osTicket can use to store its data. 33 | 34 | ```bash 35 | docker run --name osticket_mysql -d -e MYSQL_ROOT_PASSWORD=secret \ 36 | -e MYSQL_USER=osticket -e MYSQL_PASSWORD=secret -e MYSQL_DATABASE=osticket mariadb 37 | ``` 38 | 39 | **Now run this image and link the MySQL container.** 40 | 41 | ```bash 42 | docker run --name osticket -d --link osticket_mysql:mysql -p 8080:80 osticket/osticket 43 | ``` 44 | 45 | Wait for the installation to complete then browse to your osTicket staff control panel at `http://localhost:8080/scp`. Login with default admin user & password: 46 | 47 | * username: **ostadmin** 48 | * password: **Admin1** 49 | 50 | Now configure as required. If you are intending on using this image in production, please make sure you change the 51 | passwords above and read the rest of this documentation! 52 | 53 | # MySQL connection 54 | 55 | The recommended connection method is to link your MySQL container to this image with the alias name ```mysql```. However, if you 56 | are using an external MySQL server then you can specify the connection details using environmental variables. 57 | 58 | osTicket requires that the MySQL connection specifies a user with full permissions to the specified database. This is required for the automatic 59 | database installation. 60 | 61 | The osTicket configuration file is re-created from the template every time the container is started. This ensures the 62 | MySQL connection details are always kept up to date automatically in case of any changes. 63 | 64 | ## Linked container Settings 65 | 66 | There are no mandatory settings required when you link your MySQL container with the alias `mysql` as per the quick start example. 67 | 68 | ## External MySQL connection settings 69 | 70 | The following environmental variables should be set when connecting to an external MySQL server. 71 | 72 | `MYSQL_HOST` 73 | 74 | The host name or IP address of the MySQL host to connect to. This is not required when you link a container 75 | with the alias `mysql`. This must be provided if not using a linked container. 76 | 77 | `MYSQL_PASSWORD` 78 | 79 | The password for the specified user used when connecting to the MySQL server. By default will use the environmental variable 80 | `MYSQL_PASSWORD` from the linked MySQL container if this is not explicitly specified. This must be provided if not 81 | using a linked container. 82 | 83 | `MYSQL_PREFIX` 84 | 85 | The table prefix for this installation. Unlikely you will need to change this as customisable table prefixes are 86 | designed for shared hosting with only a single MySQL database available. Defaults to 'ost_'. 87 | 88 | `MYSQL_DATABASE` 89 | 90 | The name of the database to connect to. Defaults to 'osticket'. 91 | 92 | `MYSQL_USER` 93 | 94 | The user name to use when connecting to the MySQL server. Defaults to 'osticket'. 95 | 96 | # Mail Configuration 97 | 98 | The image does not run a MTA. Although one could be installed quite easily, getting the setup so that external mail servers 99 | will accept mail from your host & domain is not trivial due to anti-spam measures. This is additionally difficult to do 100 | from ephemeral docker containers that run in a cloud where the host may change etc. 101 | 102 | Hence this image supports osTicket sending of mail by sending directly to designated a SMTP server. 103 | However, you must provide the relevant SMTP settings through environmental variables before this will function. 104 | 105 | To automatically collect email from an external IMAP or POP3 account, configure the settings for the relevant email address in 106 | your admin control panel as normal (Admin Panel -> Emails). 107 | 108 | ## SMTP Settings 109 | 110 | `SMTP_HOST` 111 | 112 | The host name (or IP address) of the SMTP server to send all outgoing mail through. Defaults to 'localhost'. 113 | 114 | `SMTP_PORT` 115 | 116 | The TCP port to connect to on the server. Defaults to '25'. Usually one of 25, 465 or 587. 117 | 118 | `SMTP_FROM` 119 | 120 | The envelope from address to use when sending email (note that is not the same as the From: header). This must be 121 | provided for sending mail to function. However, if not specified, this will default to the value of `SMTP_USER` if this is provided. 122 | 123 | `SMTP_TLS` 124 | 125 | Boolean (1 or 0) value indicating if TLS should be used to create a secure connection to the server. Defaults to true. 126 | 127 | `SMTP_TLS_CERTS` 128 | 129 | If TLS is in use, indicates file containing root certificates used to verify server certificate. Defaults to system 130 | installed ca certificates list. This would normally only need changed if you are using your own certificate authority 131 | or are connecting to a server with a self signed certificate. 132 | 133 | `SMTP_USER` 134 | 135 | The user identity to use for SMTP authentication. Specifying a value here will enable SMTP authentication. This will also 136 | be used for the `SMTP_FROM` value if this is not explicitly specified. Defaults to no value. 137 | 138 | `SMTP_PASSWORD` 139 | 140 | The password associated with the user for SMTP authentication. Defaults to no value. 141 | 142 | ## IMAP/POP3 Settings 143 | 144 | `CRON_INTERVAL` 145 | 146 | Specifies how often (in minutes) that osTicket cron script should be ran to check for incoming emails. Defaults to 5 147 | minutes. Set to 0 to disable running of cron script. Note that this works in conjuction with the email check interval 148 | specified in the admin control panel, you need to specify both to the value you'd like! 149 | 150 | # Environmental Variables 151 | 152 | `INSTALL_SECRET` 153 | 154 | Secret string value for OST installation. A random value is generated on start-up and persisted within the container if this is not provided. 155 | 156 | *If using in production you should specify this so that re-creating the container does not cause 157 | your installation secret to be lost!* 158 | 159 | `INSTALL_CONFIG` 160 | 161 | If you require a configuration file for osTicket with custom content then you should create one and mount it in your 162 | container as a volume. The placeholders for the MySQL connection must be retained as these will be populated automatically 163 | when the container starts. Set this environmental variable to the fully qualified file name of your custom configuration. 164 | If not specified, the default osTicket sample configuration file is used. 165 | 166 | `INSTALL_EMAIL` 167 | 168 | Helpdesk email account. This is placed in the configuration file as well as the DB during installation. 169 | Defaults to 'helpdesk@example.com' 170 | 171 | ## Database Installation Only 172 | 173 | The remaining environmental variables can be used as a convenience to provide defaults during the automated database 174 | installation but most of these settings can be changed through the admin panel if required. These are only used when creating 175 | the initial database. 176 | 177 | `INSTALL_NAME` 178 | 179 | The name of the helpdesk to create if installing. Defaults to "My Helpdesk". 180 | 181 | `ADMIN_FIRSTNAME` 182 | 183 | First name of automatically created administrative user. Defaults to 'Admin'. 184 | 185 | `ADMIN_LASTNAME` 186 | 187 | Last name of automatically created administrative user. Defaults to 'User'. 188 | 189 | `ADMIN_EMAIL` 190 | 191 | Email address of automatically created administrative user. Defaults to 'admin@example.com'. 192 | 193 | `ADMIN_USERNAME` 194 | 195 | User name to use for automatically created administrative user. Defaults to 'ostadmin'. 196 | 197 | `ADMIN_PASSWORD` 198 | 199 | Password to use for automatically created administrative user. Defaults to 'Admin1'. 200 | 201 | # Modifications 202 | 203 | This image was put together relatively quickly and could probably be improved to meet other use cases. 204 | 205 | Please feel free to open an issue if you have any changes you would like to see. All pull requests are also appreciated! 206 | 207 | # License 208 | 209 | Installer script in this image and docs was based on [CampbellSoftwareSolutions/docker-osticket](https://github.com/CampbellSoftwareSolutions/docker-osticket) that itself was created from a fork of docker-osticket image by [Petter A. Helset](mailto:petter@helset.eu). 210 | This image and source code is made available under the MIT licence. See the LICENSE file for details. 211 | -------------------------------------------------------------------------------- /bin/osticket-install.php: -------------------------------------------------------------------------------- 1 | getenv("INSTALL_NAME") ?: 'My Helpdesk', 29 | 'email' => getenv("INSTALL_EMAIL") ?: 'helpdesk@example.com', 30 | 'fname' => getenv("ADMIN_FIRSTNAME") ?: 'Admin', 31 | 'lname' => getenv("ADMIN_LASTNAME") ?: 'User', 32 | 'admin_email' => getenv("ADMIN_EMAIL") ?: 'admin@example.com', 33 | 'username' => getenv("ADMIN_USERNAME") ?: 'ostadmin', 34 | 'passwd' => getenv("ADMIN_PASSWORD") ?: 'Admin1', 35 | 'passwd2' => getenv("ADMIN_PASSWORD") ?: 'Admin1', 36 | 'prefix' => getenv("MYSQL_PREFIX") ?: 'ost_', 37 | 'dbhost' => getenv("MYSQL_HOST") ?: 'mysql', 38 | 'dbname' => getenv("MYSQL_DATABASE") ?: 'osticket', 39 | 'dbuser' => getenv("MYSQL_USER") ?: 'osticket', 40 | 'dbpass' => getenv("MYSQL_PASSWORD") ?: getenv("MYSQL_ENV_MYSQL_PASSWORD"), 41 | 'smtp_host' => getenv("SMTP_HOST") ?: 'localhost', 42 | 'smtp_port' => getenv("SMTP_PORT") ?: 25, 43 | 'smtp_from' => getenv("SMTP_FROM"), 44 | 'smtp_tls' => getenv("SMTP_TLS"), 45 | 'smtp_tls_certs' => getenv("SMTP_TLS_CERTS") ?: '/etc/ssl/certs/ca-certificates.crt', 46 | 'smtp_user' => getenv("SMTP_USER"), 47 | 'smtp_pass' => getenv("SMTP_PASSWORD"), 48 | 'cron_interval' => getenv("CRON_INTERVAL") ?: 5, 49 | 'siri' => getenv("INSTALL_SECRET"), 50 | 'config' => getenv("INSTALL_CONFIG") ?: INSTALL_CONFIG, 51 | ); 52 | 53 | // Helper functions 54 | function err( $msg) { 55 | echo '************** INSTALLER FATAL ERROR ***************'; 56 | echo "$msg\n"; 57 | echo '****************************************************'; 58 | echo "Die :("; 59 | exit(1); 60 | } 61 | 62 | function boolToOnOff($v) { 63 | return ((boolean) $v) ? 'on' : 'off'; 64 | } 65 | 66 | function convertStrToBool($varName, $default) { 67 | global $vars; 68 | if ($vars[$varName] != '') { 69 | return $vars[$varName] == '1'; 70 | } 71 | return $default; 72 | } 73 | 74 | // Require files (must be done before any output to avoid session start warnings) 75 | // $_SERVER['HTTP_ACCEPT_LANGUAGE'] = LANGUAGE; 76 | chdir(SETUP_DIR); 77 | require SETUP_DIR.'setup.inc.php'; 78 | require SETUP_DIR.'inc/class.installer.php'; 79 | 80 | /************************* Mail Configuration *******************************************/ 81 | echo "Configuring mail settings\n"; 82 | 83 | if (!$mailConfig = file_get_contents(MAIL_CONFIG)) { 84 | err("Failed to load mail configuration file"); 85 | }; 86 | 87 | $mailConfig = str_replace('%SMTP_HOSTNAME%', $vars['smtp_host'], $mailConfig); 88 | $mailConfig = str_replace('%SMTP_PORT%', $vars['smtp_port'], $mailConfig); 89 | $v = !empty($vars['smtp_from']) ? $vars['smtp_from'] : $vars['smtp_user']; 90 | $mailConfig = str_replace('%SMTP_FROM%', $v, $mailConfig); 91 | $mailConfig = str_replace('%SMTP_USER%', $vars['smtp_user'], $mailConfig); 92 | $mailConfig = str_replace('%SMTP_PASS%', $vars['smtp_pass'], $mailConfig); 93 | $mailConfig = str_replace('%SMTP_TLS_CERTS%', $vars['smtp_tls_certs'], $mailConfig); 94 | $mailConfig = str_replace('%SMTP_TLS%', boolToOnOff(convertStrToBool('smtp_tls',true)), $mailConfig); 95 | $mailConfig = str_replace('%SMTP_AUTH%', boolToOnOff($vars['smtp_user'] != ''), $mailConfig); 96 | 97 | if (!file_put_contents(MAIL_CONFIG_FILE, $mailConfig) || !chown(MAIL_CONFIG_FILE,'www-data') 98 | || !chgrp(MAIL_CONFIG_FILE,'www-data') || !chmod(MAIL_CONFIG_FILE,0600)) { 99 | err("Failed to write mail configuration file"); 100 | } 101 | 102 | //Cron interval - enable or disable 103 | $interval = (int)$vars['cron_interval']; 104 | if ($interval > 0) { 105 | echo "OSTicket cron job is set to run every {$interval} minutes\n"; 106 | $cron = "*/{$interval} * * * * www-data /usr/bin/php ".CRON_JOB_SCRIPT."\n"; 107 | file_put_contents(CRON_JOB_FILE, $cron); 108 | } else { 109 | echo "OSTicket cron job is disabled\n"; 110 | unlink(CRON_JOB_FILE); 111 | } 112 | 113 | /************************* OSTicket Installation *******************************************/ 114 | 115 | // Create installer class 116 | $installer = new Installer(OSTICKET_CONFIGFILE); //Installer instance. 117 | 118 | // Determine if using linked container 119 | $linked = (boolean)getenv("MYSQL_PORT"); 120 | if (!$linked) { 121 | echo "Using external MySQL connection\n"; 122 | //Check mandatory connection settings provided 123 | if (!getenv("MYSQL_HOST")) { 124 | err('Missing required environmental variable MYSQL_HOST'); 125 | } 126 | if (!getenv("MYSQL_PASSWORD")) { 127 | err('Missing required environmental variable: MYSQL_PASSWORD'); 128 | } 129 | } else { 130 | echo "Using linked MySQL container\n"; 131 | } 132 | 133 | // Wait for database connection 134 | echo "Waiting for database TCP connection to become available...\n"; 135 | $s = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 136 | $t = 0; 137 | while (!@socket_connect($s,$vars['dbhost'],3306) && $t < CONNECTION_TIMEOUT_SEC) { 138 | $t++; 139 | if (($t % 15) == 0) { 140 | echo "Waited for $t seconds...\n"; 141 | } 142 | sleep(1); 143 | } 144 | if ($t >= CONNECTION_TIMEOUT_SEC) { 145 | err("Timed out waiting for database TCP connection"); 146 | } 147 | 148 | // Check database installation status 149 | $db_installed = false; 150 | echo "Connecting to database mysql://${vars['dbuser']}@${vars['dbhost']}/${vars['dbname']}\n"; 151 | if (!db_connect($vars['dbhost'],$vars['dbuser'],$vars['dbpass'])) 152 | err(sprintf(__('Unable to connect to MySQL server: %s'), db_connect_error())); 153 | elseif(explode('.', db_version()) < explode('.', $installer->getMySQLVersion())) 154 | err(sprintf(__('osTicket requires MySQL %s or later!'),$installer->getMySQLVersion())); 155 | elseif(!db_select_database($vars['dbname']) && !db_create_database($vars['dbname'])) { 156 | err("Database doesn't exist"); 157 | } elseif(!db_select_database($vars['dbname'])) { 158 | err('Unable to select the database'); 159 | } else { 160 | $sql = 'SELECT * FROM `'.$vars['prefix'].'config` LIMIT 1'; 161 | if(db_query($sql, false)) { 162 | $db_installed = true; 163 | echo "Database already installed\n"; 164 | } 165 | } 166 | 167 | // Create secret if not set by env var and not previously stored 168 | if (!$vars['siri']) { 169 | if (file_exists(SECRET_FILE)) { 170 | echo "Loading installation secret\n"; 171 | $vars['siri'] = file_get_contents(SECRET_FILE); 172 | } else { 173 | echo "Generating new installation secret and saving\n"; 174 | //Note that this randomly generated value is not intended to secure production sites! 175 | $vars['siri'] = substr(str_shuffle("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_="), 0, 32); 176 | file_put_contents(SECRET_FILE, $vars['siri']); 177 | } 178 | } else { 179 | echo "Using installation secret from INSTALL_SECRET environmental variable\n"; 180 | } 181 | 182 | // Always rewrite config file in case MySQL details changed (e.g. ip address) 183 | echo "Updating configuration file\n"; 184 | if (!$configFile = file_get_contents($vars['config'])) { 185 | err("Failed to load configuration file: {$vars['config']}"); 186 | }; 187 | 188 | $configFile= str_replace("define('OSTINSTALLED',FALSE);","define('OSTINSTALLED',TRUE);",$configFile); 189 | $configFile= str_replace('%ADMIN-EMAIL',$vars['admin_email'],$configFile); 190 | $configFile= str_replace('%CONFIG-DBHOST',$vars['dbhost'],$configFile); 191 | $configFile= str_replace('%CONFIG-DBNAME',$vars['dbname'],$configFile); 192 | $configFile= str_replace('%CONFIG-DBUSER',$vars['dbuser'],$configFile); 193 | $configFile= str_replace('%CONFIG-DBPASS',$vars['dbpass'],$configFile); 194 | $configFile= str_replace('%CONFIG-PREFIX',$vars['prefix'],$configFile); 195 | $configFile= str_replace('%CONFIG-SIRI',$vars['siri'],$configFile); 196 | if (!file_put_contents($installer->getConfigFile(), $configFile)) { 197 | err("Failed to write configuration file"); 198 | } 199 | 200 | // Perform database installation if required 201 | if (!$db_installed) { 202 | echo "Installing database. Please wait...\n"; 203 | if (!$installer->install($vars)) { 204 | $errors=$installer->getErrors(); 205 | echo "Database installation failed. Errors:\n"; 206 | foreach($errors as $e) { 207 | echo " $e\n"; 208 | } 209 | exit(1); 210 | } else { 211 | echo "Database installation successful\n"; 212 | } 213 | } 214 | 215 | // Update system language 216 | echo "Setting system language to ".LANGUAGE."\n"; 217 | $sql = "INSERT INTO `".$vars['prefix']."config` (`id`, `namespace`, `key`, `value`, `updated`) VALUES (NULL, 'core', 'system_language', '".LANGUAGE."', CURRENT_TIMESTAMP);"; 218 | if(db_query($sql, false)) { 219 | echo "System Language Set\n"; 220 | } 221 | 222 | // Install finished 223 | echo "Install Script finished!\n"; 224 | -------------------------------------------------------------------------------- /bin/update: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | LOCK_FILE=/update.lock 5 | 6 | # Check if lock file exists 7 | if [ -f $LOCK_FILE ] ; then 8 | # Check if really running 9 | PID=`cat $LOCK_FILE` 10 | if [ kill -s 0 $PID ] ; then 11 | echo "$LOCK_FILE' with PID=$PID exists and running..." 12 | exit 1 13 | fi 14 | echo "Warn: Cleaning stale lock file..." 15 | fi 16 | 17 | # Update lockfile with current PID 18 | echo $$ > $LOCK_FILE 19 | 20 | # Fix 21 | fix 22 | 23 | # Go to src 24 | cd /var/www/src 25 | 26 | # Git repo 27 | if [ ! -z $GIT_REPO ]; then 28 | if [ -d .git ] ; then 29 | run-as-www git pull 30 | else 31 | rmdir public 32 | run-as-www git clone $GIT_REPO . 33 | fi 34 | fi 35 | 36 | # Composer 37 | if [ -f composer.json ] ; then 38 | run-as-www composer install --no-dev --no-interaction --no-progress --optimize-autoloader 39 | fi 40 | 41 | # .env 42 | if [ -f .env.example ] && [ ! -f .env ]; then 43 | run-as-www cp -v .env.example .env 44 | fi 45 | 46 | # Laravel 47 | if [ -f artisan ] ; then 48 | source .env 49 | if [ -z $APP_KEY ]; then 50 | run-as-www php artisan key:generate 51 | fi 52 | run-as-www php artisan migrate || true 53 | fi 54 | 55 | # Yarn (do in background) 56 | if [ -f yarn.lock ] ; then 57 | yarn-build & 58 | fi 59 | 60 | # User script 61 | if [ -x /bin/vendor ] ; then 62 | run-as-www vendor 63 | fi 64 | 65 | # Remove lock file 66 | rm /update.lock 67 | -------------------------------------------------------------------------------- /bin/vendor: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Vendor script that runs on every container update event 3 | 4 | echo Deploying osTicket 5 | php /var/www/src/manage.php deploy -sfCgv /var/www/src/public || exit 1 6 | 7 | echo Install/Update osTicket 8 | php /bin/osticket-install.php || exit 1 9 | 10 | echo Applying configuration file security 11 | chmod 644 /var/www/src/public/include/ost-config.php 12 | 13 | echo Removing setup files 14 | rm -r /var/www/src/public/setup 15 | 16 | echo Install/Update osTicket plugins 17 | cd /var/www/src/public/include/plugins 18 | if [ ! -d .git ] ;then 19 | yes | GIT_SSH_COMMAND='ssh -o StrictHostKeyChecking=no' git clone --recursive "https://github.com/osTicket/osTicket-plugins.git" /tmp/plugins 20 | cp -rv /tmp/plugins/ .. 21 | rm -r /tmp/plugins 22 | fi 23 | 24 | git reset --hard 25 | git pull 26 | php make.php hydrate & 27 | 28 | if ! [ -z $LANGUAGE ] ; then 29 | echo Install/Update support for $LANGUAGE 30 | cd /var/www/src/public/include/i18n 31 | if [ ! -f $LANGUAGE.phar ] ; then 32 | curl -#L http://osticket.com/sites/default/files/download/lang/$LANGUAGE.phar > $LANGUAGE.phar 33 | else 34 | echo $LANGUAGE is already installed! 35 | fi 36 | fi 37 | -------------------------------------------------------------------------------- /build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build -t osticket/osticket -f Dockerfile . -------------------------------------------------------------------------------- /conf/msmtp: -------------------------------------------------------------------------------- 1 | # msmtp configuration template 2 | # 3 | # This is populated and saved as /etc/msmtp when image starts 4 | # 5 | 6 | # Default settings 7 | defaults 8 | logfile /var/log/msmtp.log 9 | 10 | # OSTicket account 11 | account osticket 12 | protocol smtp 13 | host %SMTP_HOSTNAME% 14 | tls %SMTP_TLS% 15 | tls_trust_file %SMTP_TLS_CERTS% 16 | port %SMTP_PORT% 17 | auth %SMTP_AUTH% 18 | user %SMTP_USER% 19 | password %SMTP_PASS% 20 | from %SMTP_FROM% 21 | 22 | # If you don't use the '-a' parameter in your command line, the default account will be used. 23 | account default: osticket 24 | -------------------------------------------------------------------------------- /conf/supervisord: -------------------------------------------------------------------------------- 1 | [program:cron] 2 | command = /usr/sbin/cron -f -L 15 3 | stdout_logfile = /var/log/cron.log 4 | stderr_logfile = /var/log/cron.log 5 | autorestart=true -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | 5 | osticket: 6 | build: . 7 | image: osticket/osticket 8 | environment: 9 | - MYSQL_HOST=mysql 10 | - MYSQL_DATABASE=osticket 11 | - MYSQL_USER=osticket 12 | - MYSQL_PASSWORD=0T1cket 13 | 14 | # CHANGE ME 15 | - INSTALL_SECRET=secret 16 | 17 | - LANGUAGE=fa 18 | 19 | links: 20 | - mysql:mysql 21 | ports: 22 | - "5335:80" 23 | restart: always 24 | 25 | mysql: 26 | image: mariadb 27 | environment: 28 | - MYSQL_RANDOM_ROOT_PASSWORD=true 29 | - MYSQL_DATABASE=osticket 30 | - MYSQL_USER=osticket 31 | - MYSQL_PASSWORD=0T1cket 32 | restart: always 33 | --------------------------------------------------------------------------------