Merge branch 'master' of https://gitlab.chiefsoft.net/MERMS/MermsProvision
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
CONFIG_NAME='This is development';
|
CONFIG_NAME='This is NOT development. It is not how envrionment works in CodeIgniter!'
|
||||||
CONTAINER_PORT=8094
|
CONTAINER_PORT=8094
|
||||||
UID=1000
|
UID=1000
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
CONFIG_NAME='This is live';
|
CONFIG_NAME='This is live'
|
||||||
CONTAINER_PORT=8094
|
CONTAINER_PORT=8094
|
||||||
UID=1000
|
UID=1000
|
||||||
|
CI_ENVIRONMENT=production
|
||||||
|
|
||||||
SERVER_PATH = production
|
SERVER_PATH = production
|
||||||
|
|
||||||
|
|||||||
@@ -23,3 +23,5 @@ ini_set('display_errors', '0');
|
|||||||
| release of the framework.
|
| release of the framework.
|
||||||
*/
|
*/
|
||||||
defined('CI_DEBUG') || define('CI_DEBUG', false);
|
defined('CI_DEBUG') || define('CI_DEBUG', false);
|
||||||
|
|
||||||
|
$_ENV['CONFIG_NAME']='<h1>I beleive you are doing CI envrionment handling wrong. You should define CI_ENVIRONMENT environment variable and utilize the respective app/Config/Boot/...php file</h1><br/>';
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ class Home extends BaseController
|
|||||||
|
|
||||||
public function what_env(): string
|
public function what_env(): string
|
||||||
{
|
{
|
||||||
$curr_env = $_ENV['CONFIG_NAME'];
|
$curr_env = env('CONFIG_NAME','undefined?');
|
||||||
echo $curr_env;
|
echo env('CI_ENVIRONMENT');
|
||||||
return $curr_env;
|
return $curr_env;
|
||||||
}
|
}
|
||||||
public function provision(): string
|
public function provision(): string
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ services:
|
|||||||
- CI_ENVIRONMENT=development
|
- CI_ENVIRONMENT=development
|
||||||
- APACHE_RUN_USER=#${UID}
|
- APACHE_RUN_USER=#${UID}
|
||||||
- APACHE_RUN_GROUP=#${UID}
|
- APACHE_RUN_GROUP=#${UID}
|
||||||
#- CI_ENV
|
- CI_ENVIRONMENT=${CI_ENVIRONMENT:-development}
|
||||||
- CI_CONFIG
|
- CI_CONFIG
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
image: registry.chiefsoft.net/mermsprovision:latest
|
image: registry.chiefsoft.net/mermsprovision:latest
|
||||||
|
|||||||
@@ -8,4 +8,8 @@
|
|||||||
AllowOverride All
|
AllowOverride All
|
||||||
Require all granted
|
Require all granted
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
|
# pass system env CI_ENVIRONMENT to Apache
|
||||||
|
PassEnv CI_ENVIRONMENT
|
||||||
|
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
@@ -1,31 +1,39 @@
|
|||||||
# Use an official PHP runtime as a base image
|
# Use an official PHP runtime as a base image
|
||||||
FROM php:8.1-apache
|
FROM php:8.1-apache
|
||||||
|
|
||||||
|
# Build args
|
||||||
|
ARG CI_ENVIRONMENT
|
||||||
|
|
||||||
|
ENV CI_ENVIRONMENT=$CI_ENVIRONMENT
|
||||||
|
|
||||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||||
#RUN apt-get update
|
#RUN apt-get update
|
||||||
|
|
||||||
|
#RUN apt-get update && apt-get install --yes --force-yes libc-client-dev libkrb5-dev
|
||||||
|
|
||||||
|
RUN apt-get update && apt-cache search libc-client
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install --yes --force-yes \
|
apt-get install --yes --force-yes \
|
||||||
cron g++ gettext libicu-dev openssl \
|
cron g++ gettext libicu-dev openssl \
|
||||||
libc-client-dev libkrb5-dev \
|
libkrb5-dev \
|
||||||
libxml2-dev libfreetype6-dev \
|
libxml2-dev libfreetype6-dev \
|
||||||
libgd-dev libmcrypt-dev bzip2 \
|
libgd-dev libmcrypt-dev bzip2 \
|
||||||
libbz2-dev libtidy-dev libcurl4-openssl-dev \
|
libbz2-dev libtidy-dev libcurl4-openssl-dev \
|
||||||
libz-dev libmemcached-dev libxslt-dev git-core libpq-dev \
|
libz-dev libmemcached-dev libxslt-dev git-core libpq-dev \
|
||||||
libzip4 libzip-dev libwebp-dev
|
libzip5 libzip-dev libwebp-dev
|
||||||
|
# libc-client-dev => libc-client2007e-dev
|
||||||
|
|
||||||
# PHP Configuration
|
# PHP Configuration
|
||||||
RUN docker-php-ext-install bcmath bz2 calendar dba exif gettext iconv intl soap tidy xsl zip&&\
|
RUN docker-php-ext-install bcmath bz2 calendar dba exif gettext iconv intl soap tidy xsl zip&&\
|
||||||
docker-php-ext-install mysqli pgsql pdo pdo_mysql pdo_pgsql &&\
|
docker-php-ext-install mysqli pgsql pdo pdo_mysql pdo_pgsql &&\
|
||||||
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp &&\
|
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp &&\
|
||||||
docker-php-ext-install gd &&\
|
docker-php-ext-install gd &&\
|
||||||
docker-php-ext-configure imap --with-kerberos --with-imap-ssl &&\
|
|
||||||
docker-php-ext-install imap &&\
|
|
||||||
docker-php-ext-configure hash --with-mhash &&\
|
docker-php-ext-configure hash --with-mhash &&\
|
||||||
pecl install xdebug && docker-php-ext-enable xdebug &&\
|
pecl install xdebug && docker-php-ext-enable xdebug &&\
|
||||||
pecl install mongodb && docker-php-ext-enable mongodb &&\
|
pecl install mongodb && docker-php-ext-enable mongodb &&\
|
||||||
pecl install redis && docker-php-ext-enable redis
|
pecl install redis && docker-php-ext-enable redis
|
||||||
|
# docker-php-ext-configure imap --with-kerberos --with-imap-ssl &&\
|
||||||
|
# docker-php-ext-install imap &&\
|
||||||
|
|
||||||
# 2. set up document root for apache
|
# 2. set up document root for apache
|
||||||
COPY docker/apache/000-default.conf /etc/apache2/sites-available/000-default.conf
|
COPY docker/apache/000-default.conf /etc/apache2/sites-available/000-default.conf
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
# Disable directory browsing
|
# Disable directory browsing
|
||||||
Options -Indexes
|
Options -Indexes
|
||||||
|
|
||||||
|
PassEnv CI_ENVIRONMENT
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Rewrite engine
|
# Rewrite engine
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user