report with docker
This commit is contained in:
33
.gitignore
vendored
33
.gitignore
vendored
@@ -1,32 +1 @@
|
|||||||
.DS_Store
|
docker-compose.[y|ya]ml
|
||||||
|
|
||||||
application/cache/*
|
|
||||||
!application/cache/index.html
|
|
||||||
|
|
||||||
application/logs/*
|
|
||||||
!application/logs/index.html
|
|
||||||
|
|
||||||
!application/*/.htaccess
|
|
||||||
|
|
||||||
composer.lock
|
|
||||||
tests/mocks/database/ci_test.sqlite
|
|
||||||
|
|
||||||
user_guide_src/build/*
|
|
||||||
user_guide_src/cilexer/build/*
|
|
||||||
user_guide_src/cilexer/dist/*
|
|
||||||
user_guide_src/cilexer/pycilexer.egg-info/*
|
|
||||||
/vendor/
|
|
||||||
|
|
||||||
# IDE Files
|
|
||||||
#-------------------------
|
|
||||||
/nbproject/
|
|
||||||
.idea/*
|
|
||||||
|
|
||||||
## Sublime Text cache files
|
|
||||||
*.tmlanguage.cache
|
|
||||||
*.tmPreferences.cache
|
|
||||||
*.stTheme.cache
|
|
||||||
*.sublime-workspace
|
|
||||||
*.sublime-project
|
|
||||||
/tests/tests/
|
|
||||||
/tests/results/
|
|
||||||
34
Dockerfile
Normal file
34
Dockerfile
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
FROM php:7.4-fpm-alpine
|
||||||
|
# FROM alpine:latest
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Essentials
|
||||||
|
RUN echo "Asia/Jakarta" > /etc/timezone
|
||||||
|
|
||||||
|
# Install nginx
|
||||||
|
RUN apk add --no-cache nginx supervisor
|
||||||
|
|
||||||
|
# Install PHP Extensions
|
||||||
|
RUN set -ex && apk --no-cache add icu-dev
|
||||||
|
RUN docker-php-ext-install opcache pdo mysqli pdo_mysql \
|
||||||
|
&& docker-php-ext-enable pdo_mysql
|
||||||
|
RUN docker-php-ext-configure intl && docker-php-ext-install intl
|
||||||
|
|
||||||
|
# Copy php-fpm configs
|
||||||
|
COPY ./_docker/php-fpm/www.conf /usr/local/etc/php-fpm.d/www.conf
|
||||||
|
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 nginx-configs
|
||||||
|
COPY ./_docker/nginx/app.conf /etc/nginx/conf.d/default.conf
|
||||||
|
COPY ./_docker/nginx/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
|
||||||
|
# Copy supervisord config
|
||||||
|
COPY ./_docker/supervisord/supervisord.conf /etc/supervisord.conf
|
||||||
|
|
||||||
|
COPY --chown=www-data:www-data ./src/ .
|
||||||
|
|
||||||
|
EXPOSE 80 443
|
||||||
|
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
|
||||||
34
Dockerfile-dev
Normal file
34
Dockerfile-dev
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
FROM php:7.4-fpm-alpine
|
||||||
|
# FROM alpine:latest
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Essentials
|
||||||
|
RUN echo "Asia/Jakarta" > /etc/timezone
|
||||||
|
|
||||||
|
# Install nginx
|
||||||
|
RUN apk add --no-cache nginx supervisor
|
||||||
|
|
||||||
|
# Install PHP Extensions
|
||||||
|
RUN set -ex && apk --no-cache add icu-dev
|
||||||
|
RUN docker-php-ext-install opcache pdo mysqli pdo_mysql \
|
||||||
|
&& docker-php-ext-enable pdo_mysql
|
||||||
|
RUN docker-php-ext-configure intl && docker-php-ext-install intl
|
||||||
|
|
||||||
|
# Copy php-fpm configs
|
||||||
|
COPY ./_docker/php-fpm/www.conf /usr/local/etc/php-fpm.d/www.conf
|
||||||
|
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 nginx-configs
|
||||||
|
COPY ./_docker/nginx/app.conf /etc/nginx/conf.d/default.conf
|
||||||
|
COPY ./_docker/nginx/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
|
||||||
|
# Copy supervisord config
|
||||||
|
COPY ./_docker/supervisord/supervisord.conf /etc/supervisord.conf
|
||||||
|
|
||||||
|
COPY --chown=www-data:www-data ./src/ .
|
||||||
|
|
||||||
|
EXPOSE 80 443
|
||||||
|
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
|
||||||
29
_docker/nginx/app.conf
Normal file
29
_docker/nginx/app.conf
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
server {
|
||||||
|
listen 80 default_server;
|
||||||
|
index index.php index.html;
|
||||||
|
root /app;
|
||||||
|
access_log /var/log/nginx/access.log;
|
||||||
|
error_log /var/log/nginx/error.log;
|
||||||
|
|
||||||
|
# set client body size#
|
||||||
|
client_max_body_size 8M;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.php?$args;
|
||||||
|
}
|
||||||
|
location ~ \.php$ {
|
||||||
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
|
fastcgi_pass 127.0.0.1:9000;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~* \.(jpe?g|gif|png|bmp|ico|css|js|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;
|
||||||
|
}
|
||||||
|
}
|
||||||
27
_docker/nginx/nginx.conf
Normal file
27
_docker/nginx/nginx.conf
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
user nginx;
|
||||||
|
|
||||||
|
worker_processes 1;
|
||||||
|
|
||||||
|
error_log /var/log/nginx/error.log warn;
|
||||||
|
pid /var/run/nginx.pid;
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
|
||||||
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||||
|
'$status $body_bytes_sent "$http_referer" '
|
||||||
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||||
|
|
||||||
|
access_log /var/log/nginx/access.log main;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
|
||||||
|
keepalive_timeout 65;
|
||||||
|
|
||||||
|
include /etc/nginx/conf.d/*.conf;
|
||||||
|
}
|
||||||
9
_docker/php-fpm/opcache.ini
Normal file
9
_docker/php-fpm/opcache.ini
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[opcache]
|
||||||
|
opcache.enable=1
|
||||||
|
opcache.revalidate_freq=0
|
||||||
|
opcache.validate_timestamps=0
|
||||||
|
opcache.max_accelerated_files=10000
|
||||||
|
opcache.memory_consumption=192
|
||||||
|
opcache.max_wasted_percentage=10
|
||||||
|
opcache.interned_strings_buffer=16
|
||||||
|
opcache.fast_shutdown=1
|
||||||
0
_docker/php-fpm/php.ini
Normal file
0
_docker/php-fpm/php.ini
Normal file
15
_docker/php-fpm/www.conf
Normal file
15
_docker/php-fpm/www.conf
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
[global]
|
||||||
|
daemonize=no
|
||||||
|
|
||||||
|
[www]
|
||||||
|
user=www-data
|
||||||
|
group=www-data
|
||||||
|
|
||||||
|
listen=127.0.0.1:9000
|
||||||
|
|
||||||
|
pm=dynamic
|
||||||
|
pm.max_children=40
|
||||||
|
pm.start_servers=2
|
||||||
|
pm.min_spare_servers=2
|
||||||
|
pm.max_spare_servers=4
|
||||||
|
pm.max_requests=500
|
||||||
9
_docker/supervisord/supervisord.conf
Normal file
9
_docker/supervisord/supervisord.conf
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[program:php-fpm]
|
||||||
|
command=/usr/local/sbin/php-fpm
|
||||||
|
|
||||||
|
[program:nginx]
|
||||||
|
command=/usr/sbin/nginx -c /etc/nginx/nginx.conf -g "daemon off;"
|
||||||
|
|
||||||
|
[supervisord]
|
||||||
|
logfile=/var/log/supervisord.log
|
||||||
|
nodaemon=true
|
||||||
3496
all-files.txt
Normal file
3496
all-files.txt
Normal file
File diff suppressed because it is too large
Load Diff
35
docker-compose-dev.yml
Normal file
35
docker-compose-dev.yml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
build:
|
||||||
|
dockerfile: Dockerfile-dev
|
||||||
|
container_name: buku-telepn-dev
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- "8081:80"
|
||||||
|
# networks:
|
||||||
|
# - proxy
|
||||||
|
volumes:
|
||||||
|
- ./src:/app
|
||||||
|
# labels:
|
||||||
|
# - traefik.enable=true
|
||||||
|
|
||||||
|
# - traefik.http.routers.${HOST}.entrypoints=http
|
||||||
|
# - traefik.http.routers.${HOST}.rule=Host(`${HOST}.${DOMAIN}`)
|
||||||
|
# - traefik.http.routers.${HOST}.service=${HOST}
|
||||||
|
# # - traefik.http.routers.${HOST}.middlewares=${HOST}-https-redirect
|
||||||
|
|
||||||
|
# - traefik.http.routers.${HOST}-secure.entrypoints=https
|
||||||
|
# - traefik.http.routers.${HOST}-secure.rule=Host(`${HOST}.${DOMAIN}`)
|
||||||
|
# - traefik.http.routers.${HOST}-secure.tls=true
|
||||||
|
# - traefik.http.routers.${HOST}-secure.service=${HOST}
|
||||||
|
|
||||||
|
# - traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=https
|
||||||
|
# - traefik.http.middlewares.${HOST}-https-redirect.redirectscheme.scheme=https
|
||||||
|
|
||||||
|
# - traefik.http.services.${HOST}.loadbalancer.server.port=80
|
||||||
|
|
||||||
|
# networks:
|
||||||
|
# proxy:
|
||||||
|
# external: true
|
||||||
30
docker-push.sh
Normal file
30
docker-push.sh
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
|
||||||
|
!/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 4fde63b07906e7bfa6b3493d76d153a3981039b9
|
||||||
|
docker login git.rssa.top -u stim -p 4fde63b07906e7bfa6b3493d76d153a3981039b9
|
||||||
|
docker push $tag
|
||||||
|
docker push $latest
|
||||||
|
|
||||||
|
#remove dangling images
|
||||||
|
docker system prune -f
|
||||||
32
src/.gitignore
vendored
Normal file
32
src/.gitignore
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
.DS_Store
|
||||||
|
|
||||||
|
application/cache/*
|
||||||
|
!application/cache/index.html
|
||||||
|
|
||||||
|
application/logs/*
|
||||||
|
!application/logs/index.html
|
||||||
|
|
||||||
|
!application/*/.htaccess
|
||||||
|
|
||||||
|
composer.lock
|
||||||
|
tests/mocks/database/ci_test.sqlite
|
||||||
|
|
||||||
|
user_guide_src/build/*
|
||||||
|
user_guide_src/cilexer/build/*
|
||||||
|
user_guide_src/cilexer/dist/*
|
||||||
|
user_guide_src/cilexer/pycilexer.egg-info/*
|
||||||
|
/vendor/
|
||||||
|
|
||||||
|
# IDE Files
|
||||||
|
#-------------------------
|
||||||
|
/nbproject/
|
||||||
|
.idea/*
|
||||||
|
|
||||||
|
## Sublime Text cache files
|
||||||
|
*.tmlanguage.cache
|
||||||
|
*.tmPreferences.cache
|
||||||
|
*.stTheme.cache
|
||||||
|
*.sublime-workspace
|
||||||
|
*.sublime-project
|
||||||
|
/tests/tests/
|
||||||
|
/tests/results/
|
||||||
@@ -23,7 +23,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
|||||||
| a PHP script and you can easily do that on your own.
|
| a PHP script and you can easily do that on your own.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
$config['base_url'] = 'http://10.10.150.135/saturssa';
|
$config['base_url'] = 'http://localhost:8080/';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
@@ -390,6 +390,7 @@ $config['sess_cookie_name'] = 'ci_session';
|
|||||||
$config['sess_samesite'] = 'Lax';
|
$config['sess_samesite'] = 'Lax';
|
||||||
$config['sess_expiration'] = 7200;
|
$config['sess_expiration'] = 7200;
|
||||||
$config['sess_save_path'] = NULL;
|
$config['sess_save_path'] = NULL;
|
||||||
|
$config['sess_save_path'] = sys_get_temp_dir();
|
||||||
$config['sess_match_ip'] = FALSE;
|
$config['sess_match_ip'] = FALSE;
|
||||||
$config['sess_time_to_update'] = 300;
|
$config['sess_time_to_update'] = 300;
|
||||||
$config['sess_regenerate_destroy'] = FALSE;
|
$config['sess_regenerate_destroy'] = FALSE;
|
||||||
@@ -76,10 +76,10 @@ $query_builder = TRUE;
|
|||||||
|
|
||||||
$db['default'] = array(
|
$db['default'] = array(
|
||||||
'dsn' => '',
|
'dsn' => '',
|
||||||
'hostname' => 'localhost',
|
'hostname' => '10.10.123.224',
|
||||||
'username' => 'root',
|
'username' => 'report',
|
||||||
'password' => '',
|
'password' => 'Mailadmin123!?',
|
||||||
'database' => 'db_saturssa',
|
'database' => 'report_coba',
|
||||||
'dbdriver' => 'mysqli',
|
'dbdriver' => 'mysqli',
|
||||||
'dbprefix' => '',
|
'dbprefix' => '',
|
||||||
'pconnect' => FALSE,
|
'pconnect' => FALSE,
|
||||||
@@ -89,6 +89,8 @@ $db['default'] = array(
|
|||||||
'char_set' => 'utf8',
|
'char_set' => 'utf8',
|
||||||
'dbcollat' => 'utf8_general_ci',
|
'dbcollat' => 'utf8_general_ci',
|
||||||
'swap_pre' => '',
|
'swap_pre' => '',
|
||||||
|
// 'autoinit' => TRUE,
|
||||||
|
// 'stricton' => FALSE
|
||||||
'encrypt' => FALSE,
|
'encrypt' => FALSE,
|
||||||
'compress' => FALSE,
|
'compress' => FALSE,
|
||||||
'stricton' => FALSE,
|
'stricton' => FALSE,
|
||||||
0
src/application/controllers/lp_organisasi.php
Normal file
0
src/application/controllers/lp_organisasi.php
Normal file
0
src/application/views/home/v_home.php
Normal file
0
src/application/views/home/v_home.php
Normal file
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user