Skip to content

Commit

Permalink
(ノ◕ヮ◕)ノ*:・゚✧ ✧゚・: *ヽ(◕ヮ◕ヽ)
Browse files Browse the repository at this point in the history
  • Loading branch information
utarsuno committed Jun 28, 2019
1 parent 93cbdff commit a0a14a6
Show file tree
Hide file tree
Showing 292 changed files with 6,704 additions and 4,065 deletions.
209 changes: 125 additions & 84 deletions applications/asset_server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,103 +1,144 @@
FROM alpine
FROM alpine:3.9

#RUN echo "ipv6" >> /etc/modules
# TODO: Look into using https://github.com/docker-library/php/tree/a9f19e9df5f7a5b74d72a97439ca5b77b87faa35/7.3/alpine3.9/cli

# update
RUN apk update && apk upgrade \
# bash
&& apk add --no-cache bash && apk add --no-cache bash-completion \
# npm
&& apk add --no-cache nodejs && apk add --no-cache nodejs-npm \
# curl
&& apk add --no-cache curl \
# "metapackage that pulls in the most essential packages used to build new packages"
&& apk add --update alpine-sdk \
# add GZIP just in case
&& apk add --no-cache gzip \
# install Postgres for compatibility
&& apk add --no-cache postgresql-dev \
&& apk add --update wget
# ----------------------------------------------------------------------------------------------------------------
# Base OS libs.
# ----------------------------------------------------------------------------------------------------------------
RUN apk update && apk upgrade && apk --no-cache add bash bash-completion nodejs nodejs-npm curl gzip postgresql-dev \
&& apk add --update alpine-sdk wget

# ----------------------------------------------------------------------------------------------------------------
# __ __
# |__) |__| |__)
# | | | |
# ----------------------------------------------------------------------------------------------------------------

# trust this project public key to trust the packages.
ADD https://php.codecasts.rocks/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub

# https://github.com/codecasts/php-alpine

RUN apk add --update ca-certificates \
&& update-ca-certificates \
&& echo "@php https://php.codecasts.rocks/v3.9/php-7.3" >> /etc/apk/repositories \
&& apk add --update php@php \
&& apk add --update php-common@php \
&& apk add --update php-fpm@php \
&& apk add --update php-cgi@php \
&& apk add --update php-doc@php \
&& apk add --update php-dev@php \
&& apk add --update php-gd@php \
&& apk add --update php-curl@php \
&& apk add --update php-openssl@php \
&& apk add --update php-dom@php --repository http://nl.alpinelinux.org/alpine/edge/testing/ \
&& apk add --update php-fpm@php \
&& apk add --update php-phar@php \
&& apk add --update php-json@php \
&& apk add --update php-iconv@php \
&& apk add --update php-openssl@php \
&& apk add --update php-zlib@php \
&& apk add --update php-iconv@php \
&& apk add --update php-mbstring@php \
&& apk add --update php-xml@php \
&& apk add --update php-zip@php \
&& apk add --update php-ctype@php \
&& apk add --update php-session@php \
# Database libraries.
&& apk add --update php-pdo@php \
&& apk add --update php-pgsql@php \
&& apk add --update php-pdo_pgsql@php \
# Set alias for 'php' --> 'php7'
&& ln -s /usr/bin/php7 /usr/bin/php

#RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer

# Deployer
#RUN curl -L0 https://deployer.org/deployer.phar --output dep && chmod +x ./dep
RUN apk --no-cache add php7 php7-fpm php7-mysqli php7-json php7-openssl php7-curl php7-zlib php7-xml \
php7-phar php7-intl php7-dom php7-xmlreader php7-ctype php7-mbstring php7-gd php7-common php7-doc \
php7-cgi php7-dev php7-iconv php7-zip php7-session php7-pdo php7-pgsql php7-pdo_pgsql php7-tokenizer \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer

# ----------------------------------------------------------------------------------------------------------------
# __
# / ` __|__ __|__
# \__, | |
# ----------------------------------------------------------------------------------------------------------------
RUN apk add --no-cache libc-dev \
&& apk add --no-cache libressl-dev \
&& apk add --no-cache gcc \
&& apk add --no-cache zlib-dev \
&& apk add --no-cache jpeg-dev \
&& apk add --no-cache boost-dev \
&& apk add --no-cache musl-dev \
&& apk add --no-cache cmake \
&& apk add libev-dev \
&& apk add linux-headers \
&& apk add libtool \
&& apk add libsodium-dev \
&& apk add automake


# && apk add --no-cache build-base \
#&& apk add openssl-dev
#RUN apk add --no-cache libc-dev \
# && apk add --no-cache libressl-dev \
# && apk add --no-cache gcc \
# && apk add --no-cache zlib-dev \
# && apk add --no-cache jpeg-dev \
# && apk add --no-cache boost-dev \
# && apk add --no-cache musl-dev \
# && apk add --no-cache cmake \
# && apk add --no-cache libev-dev \
# && apk add --no-cache linux-headers \
# && apk add --no-cache libtool \
# && apk add --no-cache libsodium-dev \
# && apk add --no-cache utomake

RUN rm /var/cache/apk/*

#COPY ./generated_output/third_party_libraries/AMQP_CPP_3_1_0 /quasar_source/generated_output/third_party_libraries/AMQP_CPP_3_1_0
#RUN cd /quasar_source/generated_output/third_party_libraries/AMQP_CPP_3_1_0 \
# && make \
# && make install

#COPY ./libraries/pre_compiled/libamqpcpp.so.3.1 /usr/lib/libamqpcpp.so.3.1
RUN echo $'[PHP] \n\
engine=On \n\
short_open_tag=Off \n\
precision=14 \n\
output_buffering=4096 \n\
zlib.output_compression=Off \n\
implicit_flush=Off \n\
serialize_precision=-1 \n\
realpath_cache_size=4096k \n\
realpath_cache_ttl=600 \n\
zend.enable_gc=On \n\
expose_php=Off \n\
max_execution_time=30 \n\
max_input_time=60 \n\
memory_limit=256M \n\
error_reporting=E_ALL & ~E_DEPRECATED & ~E_STRICT \n\
display_errors=On \n\
display_startup_errors=On \n\
log_errors=On \n\
log_errors_max_len=1024 \n\
ignore_repeated_errors=Off \n\
ignore_repeated_source=Off \n\
report_memleaks=On \n\
html_errors=Off \n\
variables_order="S" \n\
request_order="GP" \n\
register_argc_argv=On \n\
auto_globals_jit=On \n\
enable_post_data_reading=Off \n\
post_max_size=8M \n\
include_path = ".:/usr/share/php7" \n\
enable_dl = Off \n\
file_uploads=On \n\
upload_max_filesize=2M \n\
max_file_uploads=20 \n\
allow_url_fopen=On \n\
allow_url_include=Off \n\
default_socket_timeout=60 \n\
[CLI Server] \n\
cli_server.color=On \n\
[Date] \n\
date.timezone=America/Chicago \n\
[ODBC] \n\
odbc.allow_persistent=On \n\
odbc.check_persistent=On \n\
odbc.max_persistent=-1 \n\
odbc.max_links=-1 \n\
odbc.defaultlrl=4096 \n\
odbc.defaultbinmode=1 \n\
[Interbase] \n\
ibase.allow_persistent=-1 \n\
[mysqlnd] \n\
mysqlnd.collect_statistics=Off \n\
mysqlnd.collect_memory_statistics=Off \n\
[PostgreSQL] \n\
pgsql.allow_persistent=On \n\
pgsql.auto_reset_persistent=On \n\
pgsql.max_persistent=-1 \n\
pgsql.max_links=-1 \n\
pgsql.ignore_notice=1 \n\
pgsql.log_notice=1 \n\
[bcmath] \n\
bcmath.scale=0 \n\
[Session] \n\
session.save_handler=files \n\
session.use_strict_mode=0 \n\
session.use_cookies=0 \n\
session.use_only_cookies=0\n\
session.name=PHPSESSID \n\
session.auto_start=-1\n\
session.serialize_handler = php \n\
session.gc_probability=1 \n\
session.gc_divisor=1000 \n\
session.gc_maxlifetime=1440 \n\
session.cache_limiter=nocache \n\
session.cache_expire=180 \n\
session.use_trans_sid=0 \n\
[Assertion] \n\
zend.assertions=-1 \n\
[Tidy] \n\
tidy.clean_output=Off \n\
[soap] \n\
soap.wsdl_cache_enabled=1 \n\
soap.wsdl_cache_dir="/tmp" \n\
soap.wsdl_cache_ttl=86400 \n\
soap.wsdl_cache_limit=5 \n\
[ldap] \n\
ldap.max_links=-1 \n\
[opcache] \n\
opcache.enable=1 \n\
opcache.enable_cli=1 \n\
opcache.file_cache_only=1 \n\
opcache.file_cache=/tmp/php-opcache \n\
opcache.validate_timestamps=1 \n\
opcache.revalidate_freq=0 \n\
op.cache.revalidate_path=1 \n\
opcache.max_accelerated_files=20000 \n\
opcache.memory_consumption=192 \n\
opcache.max_wasted_percentage=10 \n\
opcache.interned_strings_buffer=16 \n\
opcache.fast_shutdown=1\n' > /etc/php7/php.ini

CMD ["bash", "/quasar_source/applications/asset_server/src/asset_server.sh"]


3 changes: 1 addition & 2 deletions applications/asset_server/code_manager/.env.dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
KERNEL_CLASS='CodeManager\Kernel'
APP_SECRET='s$cretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
3 changes: 1 addition & 2 deletions applications/asset_server/code_manager/.env.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
KERNEL_CLASS='CodeManager\Kernel'
APP_SECRET='s$cretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
1 change: 0 additions & 1 deletion applications/asset_server/code_manager/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

###> symfony/framework-bundle ###
/.env.local
/.env.local.php
Expand Down
8 changes: 4 additions & 4 deletions applications/asset_server/code_manager/bin/console
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env php
<?php
<?php declare(strict_types=1);

use CodeManager\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;

if (false === in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.\PHP_SAPI.' SAPI'.\PHP_EOL;
if (false === in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '. PHP_SAPI .' SAPI'. PHP_EOL;
}

set_time_limit(0);
Expand Down Expand Up @@ -37,6 +37,6 @@ if ($_SERVER['APP_DEBUG']) {
}
}

$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$application = new Application($kernel);
$application->run($input);
38 changes: 22 additions & 16 deletions applications/asset_server/code_manager/composer.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
{
"type": "project",
"license": "MIT",
"require": {
"php": "7.3.*",
"ext-ctype": "*",
"ext-iconv": "*",
"type" : "project",
"license" : "MIT",
"name" : "code_manager/code_manager",
"description": "Automated processes to manage and build Quasar Source.",
"require" : {
"php" : "7.2.*",
"ext-ctype" : "*",
"ext-iconv" : "*",
"doctrine/doctrine-bundle": "^1.10",
"symfony/console": "4.2.*",
"symfony/dotenv": "4.2.*",
"symfony/event-dispatcher": "4.2.*",
"symfony/flex": "^1.1",
"doctrine/persistence" : "1.*",
"doctrine/reflection" : "1.*",
"symfony/config" : "4.2.*",
"symfony/console" : "4.*",
"symfony/doctrine-bridge" : "4.*",
"symfony/dotenv" : "4.*",
"symfony/event-dispatcher": "4.*",
"symfony/flex" : "^1.1",
"symfony/framework-bundle": "4.2.*",
"symfony/monolog-bundle": "^3.3",
"symfony/orm-pack": "^1.0",
"symfony/phpunit-bridge": "4.2.*",
"symfony/process": "4.2.*",
"symfony/yaml": "4.2.*"
"symfony/monolog-bundle" : "^3.3",
"symfony/orm-pack" : "^1.0",
"symfony/phpunit-bridge" : "4.*",
"symfony/process" : "4.*",
"symfony/yaml" : "4.*"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
"sort-packages": false
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions applications/asset_server/code_manager/config/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);

use Symfony\Component\Dotenv\Dotenv;

Expand All @@ -8,7 +8,7 @@
// Run "composer dump-env prod" to create it (requires symfony/flex >=1.2)
if (is_array($env = @include dirname(__DIR__).'/.env.local.php')) {
$_ENV += $env;
} elseif (!class_exists(Dotenv::class)) {
} else if (!class_exists(Dotenv::class)) {
throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.');
} else {
// load all the .env files
Expand Down
3 changes: 1 addition & 2 deletions applications/asset_server/code_manager/config/bundles.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?php
<?php declare(strict_types=1);

return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
];
17 changes: 0 additions & 17 deletions applications/asset_server/code_manager/config/packages/cache.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,2 @@
framework:
cache:
# Put the unique name of your app here: the prefix seed
# is used to compute stable namespaces for cache keys.
#prefix_seed: your_vendor_name/app_name

# The app cache caches to the filesystem by default.
# Other options include:

# Redis
#app: cache.adapter.redis
#default_redis_provider: redis://localhost

# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
#app: cache.adapter.apcu

# Namespaced pools use the above "app" backend by default
#pools:
#my.dedicated.cache: ~
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ monolog:
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: ["!event"]
# uncomment to get logging in your browser
# you may have to allow bigger header sizes in your Web server configuration
#firephp:
# type: firephp
# level: info
#chromephp:
# type: chromephp
# level: info
console:
type: console
process_psr_3_messages: false
Expand Down
Loading

0 comments on commit a0a14a6

Please sign in to comment.