Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Commit

Permalink
Make the config dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Oct 3, 2022
1 parent f650dbf commit 32dbd4a
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docker-compose-latest.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ services:
easyappointments:
container_name: easyappointments
image: ${IMAGE_TAG}
environment:
BASE_URL: http://easyappointments
DB_HOST: mariadb
DB_NAME: public
DB_USERNAME: public
DB_PASSWORD: public
depends_on:
mariadb:
condition: service_healthy
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ COPY horust/ /etc/horust/
COPY nginx-default.conf /etc/nginx/http.d/default.conf
COPY nginx.conf /etc/nginx/nginx.conf
COPY php-fpm-www-pool.conf /etc/php8/php-fpm.d/www.conf
COPY config.php ./

# Switch to user
USER deploy:deploy
Expand Down
67 changes: 67 additions & 0 deletions docker/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php
/* ----------------------------------------------------------------------------
* Easy!Appointments - Open Source Web Scheduler
*
* @package EasyAppointments
* @author A.Tselegidis <[email protected]>
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
* @link http://easyappointments.org
* @since v1.0.0
* ---------------------------------------------------------------------------- */

/**
* Easy!Appointments Configuration File
*
* Set your installation BASE_URL * without the trailing slash * and the database
* credentials in order to connect to the database. You can enable the DEBUG_MODE
* while developing the application.
*
* Set the default language by changing the LANGUAGE constant. For a full list of
* available languages look at the /application/config/config.php file.
*
* IMPORTANT:
* If you are updating from version 1.0 you will have to create a new "config.php"
* file because the old "configuration.php" is not used anymore.
*/
$baseUrl = getenv('BASE_URL');
$dbHost = getenv('DB_HOST');
$dbName = getenv('DB_NAME');
$dbUsername = getenv('DB_USERNAME');
$dbPassword = getenv('DB_PASSWORD');

eval(<<<PHP
class Config {
// ------------------------------------------------------------------------
// GENERAL SETTINGS
// ------------------------------------------------------------------------
const BASE_URL = '$baseUrl';
const LANGUAGE = 'french';
const DEBUG_MODE = FALSE;
// ------------------------------------------------------------------------
// DATABASE SETTINGS
// ------------------------------------------------------------------------
const DB_HOST = '$dbHost';
const DB_NAME = '$dbName';
const DB_USERNAME = '$dbUsername';
const DB_PASSWORD = '$dbPassword';
// ------------------------------------------------------------------------
// GOOGLE CALENDAR SYNC
// ------------------------------------------------------------------------
const GOOGLE_SYNC_FEATURE = FALSE; // Enter TRUE or FALSE
const GOOGLE_PRODUCT_NAME = '';
const GOOGLE_CLIENT_ID = '';
const GOOGLE_CLIENT_SECRET = '';
const GOOGLE_API_KEY = '';
}
/* End of file config.php */
/* Location: ./config.php */
PHP
);

0 comments on commit 32dbd4a

Please sign in to comment.