add env files for api and docker-compose update
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
FROM yiisoftware/yii2-php:8.3-apache
|
||||
|
||||
# Change document root for Apache
|
||||
RUN sed -i -e 's|/app/web|/app/api/web|g' /etc/apache2/sites-available/000-default.conf
|
||||
|
||||
RUN echo "xdebug.client_port=9003" >> /usr/local/etc/php/conf.d/xdebug.ini
|
||||
RUN echo "xdebug.idekey=api" >> /usr/local/etc/php/conf.d/xdebug.ini
|
||||
|
||||
@@ -14,6 +14,20 @@ services:
|
||||
extra_hosts: # https://stackoverflow.com/a/67158212/1106908
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
||||
api:
|
||||
build: api
|
||||
ports:
|
||||
- "20081:80"
|
||||
environment:
|
||||
- PHP_ENABLE_XDEBUG=1
|
||||
volumes:
|
||||
# Re-use local composer cache via host-volume
|
||||
- ~/.composer-docker/cache:/root/.composer/cache:delegated
|
||||
# Mount source-code for development
|
||||
- ./:/app
|
||||
extra_hosts: # https://stackoverflow.com/a/67158212/1106908
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
||||
mysql:
|
||||
image: mysql:8
|
||||
environment:
|
||||
|
||||
28
environments/dev/api/web/index-test.php
Normal file
28
environments/dev/api/web/index-test.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
// NOTE: Make sure this file is not accessible when deployed to production
|
||||
if (!in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'])) {
|
||||
die('You are not allowed to access this file.');
|
||||
}
|
||||
|
||||
defined('YII_DEBUG') or define('YII_DEBUG', true);
|
||||
defined('YII_ENV') or define('YII_ENV', 'test');
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php';
|
||||
require __DIR__ . '/../../common/config/bootstrap.php';
|
||||
require __DIR__ . '/../config/bootstrap.php';
|
||||
|
||||
|
||||
$config = yii\helpers\ArrayHelper::merge(
|
||||
require __DIR__ . '/../../common/config/main.php',
|
||||
require __DIR__ . '/../../common/config/main-local.php',
|
||||
require __DIR__ . '/../../common/config/test.php',
|
||||
require __DIR__ . '/../../common/config/test-local.php',
|
||||
require __DIR__ . '/../config/main.php',
|
||||
require __DIR__ . '/../config/main-local.php',
|
||||
require __DIR__ . '/../config/test.php',
|
||||
require __DIR__ . '/../config/test-local.php'
|
||||
);
|
||||
|
||||
(new yii\web\Application($config))->run();
|
||||
18
environments/dev/api/web/index.php
Normal file
18
environments/dev/api/web/index.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
defined('YII_DEBUG') or define('YII_DEBUG', true);
|
||||
defined('YII_ENV') or define('YII_ENV', 'dev');
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php';
|
||||
require __DIR__ . '/../../common/config/bootstrap.php';
|
||||
require __DIR__ . '/../config/bootstrap.php';
|
||||
|
||||
$config = yii\helpers\ArrayHelper::merge(
|
||||
require __DIR__ . '/../../common/config/main.php',
|
||||
require __DIR__ . '/../../common/config/main-local.php',
|
||||
require __DIR__ . '/../config/main.php',
|
||||
require __DIR__ . '/../config/main-local.php'
|
||||
);
|
||||
|
||||
(new yii\web\Application($config))->run();
|
||||
2
environments/dev/api/web/robots.txt
Normal file
2
environments/dev/api/web/robots.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
User-agent: *
|
||||
Disallow: /
|
||||
Reference in New Issue
Block a user