Skip to content

Commit

Permalink
fix supervisor -c config path, Dockerfile fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vsilent committed Jun 13, 2019
1 parent c79c33c commit a488758
Show file tree
Hide file tree
Showing 20 changed files with 4,582 additions and 90 deletions.
55 changes: 55 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Created by .ignore support plugin (hsz.mobi)
# Ide #
##################
.classpath
.project
.settings
.idea
.metadata
*.iml
*.ipr
##################

# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so

# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

# Logs and databases #
######################
*.log
*.sql
*.sqlite

# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# WWW folder #
www/

# python
__pycache__
21 changes: 0 additions & 21 deletions 1.10/build/Dockerfile

This file was deleted.

3 changes: 0 additions & 3 deletions 1.10/build/build.sh

This file was deleted.

28 changes: 0 additions & 28 deletions 1.10/build/configs/ost/config.xml

This file was deleted.

22 changes: 0 additions & 22 deletions 1.10/build/configs/supervisord/ost.conf

This file was deleted.

12 changes: 0 additions & 12 deletions 1.10/build/docker-compose.yml

This file was deleted.

Binary file removed 1.10/build/src/osTicket-v1.10.4.zip
Binary file not shown.
18 changes: 18 additions & 0 deletions 1.12/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
REGISTRY=
DOMAIN=localdomain

# SMTP docker image
SMTP_IMAGE={{SMTP_IMAGE}}
EMAIl_ADMIN=admin@localhost
EMAIL_USE_TLS=False
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_HOST_USER=[email protected]
EMAIL_HOST_PASSWORD=pass
DEFAULT_FROM_EMAIL=[email protected]

MYSQL_DATABASE=osticket
MYSQ_USER=osticket
MYSQL_ROOT_PASSWORD=osticketroot

DEBUG=True
23 changes: 23 additions & 0 deletions 1.12/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM ubuntu:18.04

LABEL maintainer="[email protected]"
ENV APP_VERSION 1.12

RUN apt-get update -y -qq ; apt-get install --no-install-recommends -y -qq supervisor software-properties-common; \
LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php -y; apt-get update -y -qq; \
apt-get install -y -qq cron curl net-tools \
php7.2 php7.2-fpm php7.2-mysql php7.2-cli php7.2-cgi php7.2-gd php7.2-zip php7.2-xml php7.2-curl \
&& apt-get clean; apt-get autoclean; apt-get autoremove -y -qq && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN groupadd -r -g 2000 osticket; useradd -r -u 2000 -g 2000 -m -c "app account" -d /home/osticket -s /bin/bash osticket
RUN curl -L -o /usr/src/app.tar.gz https://github.com/osTicket/osTicket/archive/v${APP_VERSION}.tar.gz
WORKDIR /home/osticket
RUN tar -xf /usr/src/app.tar.gz && mv osTicket-${APP_VERSION} app
RUN chown -R osticket:osticket app
ADD ./configs/php/fpm/php.ini /etc/php/7.2/fpm/php.ini
ADD ./configs/php/fpm/www.conf /etc/php/7.2/fpm/pool.d/www.conf
ADD ./configs/supervisord/osticket.conf /etc/supervisor/conf.d/osticket.conf
RUN mkdir /run/php && chown -R osticket:osticket /run/php

EXPOSE 9000
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/osticket.conf"]
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
user = ost
group = ost
user = osticket
group = osticket

; The address on which to accept FastCGI requests.
; Valid syntaxes are:
Expand All @@ -44,8 +44,8 @@ listen = 127.0.0.1:9000
; BSD-derived systems allow connections regardless of permissions.
; Default Values: user and group are set as the running user
; mode is set to 0660
listen.owner = www-data
listen.group = www-data
;listen.owner = www-data
;listen.group = www-data
;listen.mode = 0660
; When POSIX Access Control Lists are supported you can set them using
; these options, value is a comma separated list of user/group names.
Expand Down
34 changes: 34 additions & 0 deletions 1.12/build/configs/supervisord/osticket.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[supervisord]
nodaemon = true
loglevel = INFO
logfile=/dev/null
logfile_maxbytes=0
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)

[unix_http_server]
file = /tmp/supervisor.sock
chmod = 0700
username = dummy
password = dummy

[supervisorctl]
username = dummy
password = dummy

[program:php-fpm]
command=/usr/sbin/php-fpm7.2 -F
stopasgroup=true
stopsignal=TERM
autostart=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true

[program:cron]
command=/usr/sbin/cron -f
stopsignal=TERM
stopasgroup=true
autostart=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true
32 changes: 32 additions & 0 deletions 1.12/configs/nginx/conf.d/osticket.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
server {
listen 80;
server_name _;
index index.php index.html;
root /usr/share/nginx/html;

# Add stdout/stderr logging
access_log /proc/self/fd/1;
error_log /proc/self/fd/2;

location ~ \.php$ {
try_files $uri /dev/null =404;
fastcgi_pass osticket:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

location / {
try_files $uri $uri/ /index.php?$query_string;
}

# deny access to . files, for security
location ~ /\. {
access_log off;
log_not_found off;
deny all;
}

gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
gzip_static on;
}
56 changes: 56 additions & 0 deletions 1.12/configs/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
user www-data;
worker_processes auto;
worker_rlimit_nofile 200000;

pid /var/run/nginx.pid;

events {
worker_connections 10000;
use epoll;
multi_accept on;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
keepalive_requests 10000;

sendfile on;
sendfile_max_chunk 512k;
tcp_nopush on;
tcp_nodelay on;

large_client_header_buffers 8 64k;
output_buffers 8 32k;
postpone_output 1460;

# 502 error fix
proxy_connect_timeout 120s;
proxy_read_timeout 120s;
proxy_busy_buffers_size 16k;
proxy_temp_file_write_size 64k;
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;

#error_log /var/log/nginx.error_log warn;
# Add stdout/stderr logging
access_log /proc/self/fd/1;
error_log /proc/self/fd/2;

log_format main '$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" '
'"$gzip_ratio"';

log_format download '$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" '
'"$http_range" "$sent_http_content_range"';

map $status $loggable {
~^[23] 0;
default 1;
}
include /etc/nginx/conf.d/*.conf;
}
Loading

0 comments on commit a488758

Please sign in to comment.