Merge branch 'rebuild_eletter' of https://git.rssa.top/dwi.firman/eletter into rebuild_eletter
This commit is contained in:
@@ -26,6 +26,7 @@ src/application/logs/*
|
|||||||
src/application/config/
|
src/application/config/
|
||||||
src/application/application/logs/
|
src/application/application/logs/
|
||||||
src/logs/
|
src/logs/
|
||||||
|
src/public/
|
||||||
|
|
||||||
### CodeIgniter Patch ###
|
### CodeIgniter Patch ###
|
||||||
|
|
||||||
@@ -41,3 +42,4 @@ src/logs/
|
|||||||
/composer.json
|
/composer.json
|
||||||
/composer.lock
|
/composer.lock
|
||||||
/docker-compose.yml
|
/docker-compose.yml
|
||||||
|
|
||||||
|
|||||||
+13
-38
@@ -1,64 +1,39 @@
|
|||||||
FROM php:7.4-fpm-alpine
|
FROM php:7.4-fpm-alpine
|
||||||
# FROM alpine:latest
|
|
||||||
|
|
||||||
ENV ACCEPT_EULA=Y
|
ENV ACCEPT_EULA=Y
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Essentials
|
|
||||||
RUN echo "Asia/Jakarta" > /etc/timezone
|
|
||||||
|
|
||||||
# Install nginx
|
# Install nginx
|
||||||
RUN apk add --no-cache nginx supervisor
|
RUN apk add --no-cache nginx supervisor bash
|
||||||
|
|
||||||
# Install prerequisites required for tools and extensions installed later on.
|
|
||||||
# RUN apk add --update bash gnupg less libpng-dev libzip-dev su-exec unzip
|
|
||||||
|
|
||||||
# # Install prerequisites for the sqlsrv and pdo_sqlsrv PHP extensions.
|
|
||||||
# RUN curl -O https://download.microsoft.com/download/3/5/5/355d7943-a338-41a7-858d-53b259ea33f5/msodbcsql18_18.3.2.1-1_amd64.apk \
|
|
||||||
# && curl -O https://download.microsoft.com/download/3/5/5/355d7943-a338-41a7-858d-53b259ea33f5/mssql-tools18_18.3.1.1-1_amd64.apk \
|
|
||||||
# && curl -O https://download.microsoft.com/download/3/5/5/355d7943-a338-41a7-858d-53b259ea33f5/msodbcsql18_18.3.2.1-1_amd64.sig \
|
|
||||||
# && curl -O https://download.microsoft.com/download/3/5/5/355d7943-a338-41a7-858d-53b259ea33f5/mssql-tools18_18.3.1.1-1_amd64.sig \
|
|
||||||
# && curl https://packages.microsoft.com/keys/microsoft.asc | gpg --import - \
|
|
||||||
# && gpg --verify msodbcsql18_18.3.2.1-1_amd64.sig msodbcsql18_18.3.2.1-1_amd64.apk \
|
|
||||||
# && gpg --verify mssql-tools18_18.3.1.1-1_amd64.sig mssql-tools18_18.3.1.1-1_amd64.apk \
|
|
||||||
# && apk add --allow-untrusted msodbcsql18_18.3.2.1-1_amd64.apk mssql-tools18_18.3.1.1-1_amd64.apk \
|
|
||||||
# && rm *.apk *.sig
|
|
||||||
|
|
||||||
# # Retrieve the script used to install PHP extensions from the source container.
|
|
||||||
# COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/bin/install-php-extensions
|
|
||||||
|
|
||||||
# # Install required PHP extensions and all their prerequisites available via apt.
|
|
||||||
# RUN chmod uga+x /usr/bin/install-php-extensions \
|
|
||||||
# && sync \
|
|
||||||
# && install-php-extensions bcmath ds exif gd intl opcache pcntl pdo_sqlsrv redis sqlsrv zip
|
|
||||||
|
|
||||||
# Install PHP Extensions
|
# Install PHP Extensions
|
||||||
RUN set -ex && apk --no-cache add icu-dev postgresql-dev
|
RUN set -ex && apk --no-cache add icu-dev postgresql-dev
|
||||||
RUN docker-php-ext-install opcache pdo mysqli pdo_mysql pgsql pdo_pgsql\
|
RUN docker-php-ext-install opcache pdo pgsql pdo_pgsql\
|
||||||
&& docker-php-ext-enable pdo_mysql pdo_pgsql
|
&& docker-php-ext-enable pdo_pgsql
|
||||||
RUN docker-php-ext-configure intl && docker-php-ext-install intl
|
RUN docker-php-ext-configure intl && docker-php-ext-install intl
|
||||||
|
|
||||||
|
|
||||||
# Copy php-fpm configs
|
# Copy php-fpm configs
|
||||||
COPY ./_docker/php-fpm/www.conf /usr/local/etc/php-fpm.d/www.conf
|
COPY ./_docker/php-fpm/www.conf /usr/local/etc/php-fpm.d/zz-docker.conf
|
||||||
COPY ./_docker/php-fpm/php.ini /usr/local/etc/php/conf.d
|
COPY ./_docker/php-fpm/php.ini /usr/local/etc/php/conf.d
|
||||||
COPY ./_docker/php-fpm/opcache.ini /usr/local/etc/php/conf.d/opcache.ini
|
COPY ./_docker/php-fpm/opcache.ini /usr/local/etc/php/conf.d/opcache.ini
|
||||||
|
COPY ./_docker/php-fpm/session.ini /usr/local/etc/php/conf.d/session.ini
|
||||||
|
|
||||||
# Copy nginx-configs
|
# Copy nginx-configs
|
||||||
COPY ./_docker/nginx/app.conf /etc/nginx/conf.d/default.conf
|
COPY ./_docker/nginx/app.conf /etc/nginx/conf.d/default.conf
|
||||||
COPY ./_docker/nginx/nginx.conf /etc/nginx/nginx.conf
|
COPY ./_docker/nginx/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
COPY ./_docker/nginx/footer.conf /etc/nginx/footer.conf
|
||||||
|
|
||||||
# Copy supervisord config
|
# Copy supervisord config
|
||||||
COPY ./_docker/supervisord/supervisord.conf /etc/supervisord.conf
|
COPY ./_docker/supervisord/supervisord.conf /etc/supervisord.conf
|
||||||
|
COPY ./_docker/supervisord/init.sh /init.sh
|
||||||
|
|
||||||
# COPY --chown=www-data:www-data ./src/ .
|
COPY --chown=www-data:www-data ./src .
|
||||||
|
|
||||||
# RUN mkdir /mnt/media
|
ARG APP_VERSION
|
||||||
# RUN chown -R www-data:www-data /mnt/media
|
ENV APP_VERSION=$APP_VERSION
|
||||||
# RUN mkdir /mnt/media/ris
|
|
||||||
# RUN chown -R www-data:www-data /mnt/media/ris
|
|
||||||
# COPY --chown=www-data:www-data ./media/ .
|
|
||||||
|
|
||||||
EXPOSE 80 443
|
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
ENTRYPOINT [ "/init.sh" ]
|
||||||
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
|
||||||
+81
-36
@@ -1,37 +1,82 @@
|
|||||||
server {
|
server {
|
||||||
listen 80 default_server;
|
listen 80 default_server;
|
||||||
index index.php index.html;
|
index index.php index.html;
|
||||||
root /app;
|
root /app;
|
||||||
access_log /var/log/nginx/access.log;
|
access_log /var/log/nginx/access.log;
|
||||||
error_log /var/log/nginx/error.log;
|
error_log /var/log/nginx/error.log;
|
||||||
|
|
||||||
# set client body size#
|
# set client body size#
|
||||||
client_max_body_size 8M;
|
client_max_body_size 8M;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.php?$args;
|
if ($request_method = 'OPTIONS') {
|
||||||
}
|
add_header 'Access-Control-Allow-Origin' '*';
|
||||||
location ~ \.php$ {
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
#
|
||||||
fastcgi_pass 127.0.0.1:9000;
|
# Custom headers and headers various browsers *should* be OK with but aren't
|
||||||
fastcgi_index index.php;
|
#
|
||||||
include fastcgi_params;
|
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
#
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
# Tell client that this pre-flight info is valid for 20 days
|
||||||
}
|
#
|
||||||
|
add_header 'Access-Control-Max-Age' 1728000;
|
||||||
try_files $uri $uri/ /index.php;
|
add_header 'Content-Type' 'text/plain; charset=utf-8';
|
||||||
if (!-e $request_filename){
|
add_header 'Content-Length' 0;
|
||||||
rewrite ^/admin/(.*)$ /admin/index.php?/$1? last;
|
return 204;
|
||||||
rewrite ^/api/(.*)$ /api/index.php?/$1? last;
|
}
|
||||||
rewrite ^/webhook/(.*)$ /webhook/index.php?/$1? last;
|
if ($request_method = 'POST') {
|
||||||
rewrite ^/(.*)$ /index.php?/$1? last;
|
add_header 'Access-Control-Allow-Origin' '*';
|
||||||
}
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||||
|
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
|
||||||
location ~* \.(jpe?g|gif|png|bmp|ico|pdf|zip|htm|html|docx?|xlsx?|pptx?|txt|wav|swf|avi|mp\d)$ {
|
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
|
||||||
access_log off;
|
}
|
||||||
log_not_found off;
|
if ($request_method = 'GET') {
|
||||||
try_files $uri $uri/ $document_root$uri /index.php?$args;
|
add_header 'Access-Control-Allow-Origin' '*';
|
||||||
expires 1w;
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||||
}
|
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
|
||||||
|
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
|
||||||
|
}
|
||||||
|
# First attempt to serve request as file, then
|
||||||
|
# as directory, then fall back to displaying a 404.
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
|
# try_files $uri $uri/ /index.php?$args;
|
||||||
|
|
||||||
|
}
|
||||||
|
location ~ \.php$ {
|
||||||
|
# include snippets/fastcgi-php.conf;
|
||||||
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
|
# fastcgi_pass 127.0.0.1:9000;
|
||||||
|
fastcgi_pass unix:/run/php-fpm.sock;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
|
|
||||||
|
fastcgi_buffers 4 4096k;
|
||||||
|
fastcgi_buffer_size 32k;
|
||||||
|
|
||||||
|
fastcgi_connect_timeout 3000s;
|
||||||
|
fastcgi_send_timeout 3000s;
|
||||||
|
fastcgi_read_timeout 3000s;
|
||||||
|
}
|
||||||
|
|
||||||
|
# try_files $uri $uri/ /index.php;
|
||||||
|
# if (!-e $request_filename){
|
||||||
|
# rewrite ^/admin/(.*)$ /admin/index.php?/$1? last;
|
||||||
|
# rewrite ^/api/(.*)$ /api/index.php?/$1? last;
|
||||||
|
# rewrite ^/(.*)$ /index.php?/$1? last;
|
||||||
|
# }
|
||||||
|
|
||||||
|
location ~* \.(jpe?g|gif|png|bmp|ico|pdf|zip|htm|html|docx?|xlsx?|pptx?|txt|wav|swf|avi|mp\d)$ {
|
||||||
|
access_log off;
|
||||||
|
log_not_found off;
|
||||||
|
try_files $uri $uri/ $document_root$uri /index.php?$args;
|
||||||
|
expires 1w;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ /\. {
|
||||||
|
access_log denied;
|
||||||
|
log_not_found off;
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+59
-26
@@ -1,27 +1,60 @@
|
|||||||
user nginx;
|
user nginx;
|
||||||
|
|
||||||
worker_processes 1;
|
worker_processes auto;
|
||||||
|
|
||||||
error_log /var/log/nginx/error.log warn;
|
error_log /var/log/nginx/error.log warn;
|
||||||
pid /var/run/nginx.pid;
|
pid /var/run/nginx.pid;
|
||||||
|
|
||||||
events {
|
events {
|
||||||
worker_connections 1024;
|
worker_connections 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
http {
|
http {
|
||||||
include /etc/nginx/mime.types;
|
include /etc/nginx/mime.types;
|
||||||
default_type application/octet-stream;
|
default_type application/octet-stream;
|
||||||
|
|
||||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||||
'$status $body_bytes_sent "$http_referer" '
|
'$status $body_bytes_sent "$http_referer" '
|
||||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||||
|
|
||||||
access_log /var/log/nginx/access.log main;
|
access_log /var/log/nginx/access.log main buffer=16k;
|
||||||
|
|
||||||
sendfile on;
|
sendfile on;
|
||||||
|
tcp_nopush on;
|
||||||
keepalive_timeout 65;
|
tcp_nodelay on;
|
||||||
|
|
||||||
include /etc/nginx/conf.d/*.conf;
|
# Timeout limit values
|
||||||
|
client_body_timeout 10;
|
||||||
|
client_header_timeout 10;
|
||||||
|
keepalive_timeout 13;
|
||||||
|
send_timeout 10;
|
||||||
|
|
||||||
|
# Buffer size
|
||||||
|
client_body_buffer_size 80k;
|
||||||
|
client_max_body_size 9m;
|
||||||
|
client_header_buffer_size 1k;
|
||||||
|
|
||||||
|
# Gzip compression
|
||||||
|
gzip on;
|
||||||
|
gzip_vary on;
|
||||||
|
gzip_proxied any;
|
||||||
|
gzip_comp_level 5;
|
||||||
|
gzip_buffers 16 8k;
|
||||||
|
gzip_http_version 1.1;
|
||||||
|
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
||||||
|
|
||||||
|
# config from simrs
|
||||||
|
# client_max_body_size 1500M;
|
||||||
|
# client_body_buffer_size 64M;
|
||||||
|
# keepalive_timeout 900;
|
||||||
|
|
||||||
|
include /etc/nginx/conf.d/*.conf;
|
||||||
|
|
||||||
|
# File Cache Opening
|
||||||
|
open_file_cache max=1024 inactive=10s;
|
||||||
|
open_file_cache_valid 60s;
|
||||||
|
open_file_cache_min_uses 2;
|
||||||
|
open_file_cache_errors on;
|
||||||
|
|
||||||
|
#footer
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
[opcache]
|
[opcache]
|
||||||
opcache.enable=1
|
opcache.enable=1
|
||||||
opcache.revalidate_freq=0
|
opcache.revalidate_freq=0
|
||||||
opcache.validate_timestamps=0
|
opcache.validate_timestamps=0
|
||||||
opcache.max_accelerated_files=10000
|
opcache.max_accelerated_files=10000
|
||||||
opcache.memory_consumption=192
|
opcache.memory_consumption=192
|
||||||
opcache.max_wasted_percentage=10
|
opcache.max_wasted_percentage=10
|
||||||
opcache.interned_strings_buffer=16
|
opcache.interned_strings_buffer=16
|
||||||
opcache.fast_shutdown=1
|
opcache.fast_shutdown=1
|
||||||
+15
-14
@@ -1,15 +1,16 @@
|
|||||||
[global]
|
[global]
|
||||||
daemonize=no
|
daemonize=no
|
||||||
|
|
||||||
[www]
|
[www]
|
||||||
user=www-data
|
user=www-data
|
||||||
group=www-data
|
group=www-data
|
||||||
|
|
||||||
listen=127.0.0.1:9000
|
listen=/run/php-fpm.sock
|
||||||
|
listen.mode = 0666
|
||||||
pm=dynamic
|
|
||||||
pm.max_children=40
|
pm=dynamic
|
||||||
pm.start_servers=2
|
pm.max_children=40
|
||||||
pm.min_spare_servers=2
|
pm.start_servers=4
|
||||||
pm.max_spare_servers=4
|
pm.min_spare_servers=4
|
||||||
|
pm.max_spare_servers=40
|
||||||
pm.max_requests=500
|
pm.max_requests=500
|
||||||
@@ -1,9 +1,15 @@
|
|||||||
[program:php-fpm]
|
[program:php-fpm]
|
||||||
command=/usr/local/sbin/php-fpm
|
command=/usr/local/sbin/php-fpm
|
||||||
|
startsecs = 1
|
||||||
[program:nginx]
|
autorestart=true
|
||||||
command=/usr/sbin/nginx -c /etc/nginx/nginx.conf -g "daemon off;"
|
process_name=php-fpm
|
||||||
|
|
||||||
[supervisord]
|
[program:nginx]
|
||||||
logfile=/var/log/supervisord.log
|
command=/usr/sbin/nginx -c /etc/nginx/nginx.conf -g "daemon off;"
|
||||||
nodaemon=true
|
startsecs = 1
|
||||||
|
autorestart=true
|
||||||
|
process_name=nginx
|
||||||
|
|
||||||
|
[supervisord]
|
||||||
|
logfile=/var/log/supervisord.log
|
||||||
|
nodaemon=true
|
||||||
|
|||||||
+2
-17
@@ -1,14 +1,5 @@
|
|||||||
version: '3.8'
|
version: '3.8'
|
||||||
|
|
||||||
# services:
|
|
||||||
# web:
|
|
||||||
# build: .
|
|
||||||
# container_name: ${HOST}
|
|
||||||
# restart: unless-stopped
|
|
||||||
# networks:
|
|
||||||
# - proxy
|
|
||||||
# volumes:
|
|
||||||
# - ./src:/app
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
build: .
|
build: .
|
||||||
@@ -16,13 +7,7 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- ./src:/app
|
- ./src:/app
|
||||||
- ./media:/app/media
|
|
||||||
# environment:
|
|
||||||
# - "APP_PORT=8080"
|
|
||||||
ports:
|
ports:
|
||||||
- "8061:80"
|
- "8061:80"
|
||||||
# networks:
|
environment:
|
||||||
# - bridge2
|
- APP_ENV=dev
|
||||||
# networks:
|
|
||||||
# bridge2:
|
|
||||||
# external: true
|
|
||||||
|
|||||||
Executable
+28
@@ -0,0 +1,28 @@
|
|||||||
|
!/bin/bash
|
||||||
|
|
||||||
|
#get image name
|
||||||
|
remote_url=$(git remote get-url origin)
|
||||||
|
image=$(echo $remote_url | sed 's|https://||g; s|.git||g')
|
||||||
|
|
||||||
|
#get branch name
|
||||||
|
branch_name=$(git rev-parse --abbrev-ref HEAD)
|
||||||
|
clean_branch_name=${branch_name##*/}
|
||||||
|
|
||||||
|
#get timestamp for the tag
|
||||||
|
timestamp=$(date +%Y%m%d%H%M%S)
|
||||||
|
|
||||||
|
app_version=$clean_branch_name-$timestamp
|
||||||
|
tag=$image:$timestamp-$clean_branch_name
|
||||||
|
latest=$image:latest-$clean_branch_name
|
||||||
|
|
||||||
|
#build image
|
||||||
|
docker build --build-arg APP_VERSION=$app_version -t $tag .
|
||||||
|
docker tag $tag $latest
|
||||||
|
|
||||||
|
#push to dockerhub
|
||||||
|
docker login git.rssa.top -u stim -p 2ad87eeef27b3ac1acd58271fdc1b4af934d180c
|
||||||
|
docker push $tag
|
||||||
|
docker push $latest
|
||||||
|
|
||||||
|
#remove dangling images
|
||||||
|
docker system prune -f
|
||||||
@@ -1 +0,0 @@
|
|||||||
1
|
|
||||||
Reference in New Issue
Block a user