Skip to content

Commit

Permalink
Add project
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grevin committed Nov 10, 2017
1 parent 8a284a9 commit 8ca6775
Show file tree
Hide file tree
Showing 11,297 changed files with 1,268,025 additions and 1 deletion.
The diff you're trying to view is too large. We only load the first 3000 changed files.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2004-2017 Eleven Labs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
80 changes: 79 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,79 @@
# docker-symfony-vue
DOCKER - SYMFONY - VUE.JS
=========================

# Requirements

- Linux (debian or ubuntu) or MacOS X
- [docker](https://docs.docker.com/)
- [docker-compose](https://docs.docker.com/compose/)

# Get project

```bash
git clone [email protected]:mdm/eleven-labs/docker-symfony-vuejs.git && cd docker-symfony-vuejs
```

# Change environment variable
```bash
cp .env.dist .env
```

```dotenv
# DATABASE
POSTGRES_DB= This is name of database
POSTGRES_USER= This is user of database
POSTGRES_PASSWORD= This is password of database
POSTGRES_PORT= This is the port of used by postgreSQL
# PORT WEB
WEB_PORT= This is web port of website
ELK_PORT= This is port of ELK
# SYMFONY
SECRET= This is the secret of Symfony
#SMTP
SMTP_USER= This is username of mail server
SMTP_PASSWORD= This is password of mail server
SMTP_HOST= This is host of mail server
SMTP_TRANSPORT= This is protocol transport of mail server
#REDIS
REDIS_DSN= This is DNS of Redis
```

# Initialize project

- Initialize project with script
```bash
bin/app init
```

- Initialize project without script
```bash
docker-compose build --force-rm --no-cache
docker-compose up -d --force-recreate
docker-compose exec -T php chmod 777 -R /var/www/symfony/var/cache
docker-compose exec -T php chmod 777 -R /var/www/symfony/var/logs
docker-compose exec -T --user www-data php composer install -n
docker-compose exec -T --user www-data php bin/console doctrine:database:create --if-not-exists --no-interaction
docker-compose exec -T --user www-data php bin/console doctrine:schema:update --no-interaction --force
docker-compose exec -T --user www-data php bin/console doctrine:fixtures:load --no-interaction

```

# Basic command with script

```bash
bin/app init # Initialize project
bin/app start # Start project
bin/app stop # Stop project
bin/app bash # Use bash inside the app container
bin/app exec # Execute a command inside the app container
bin/app destroy # Remove all the project Docker containers with their volumes
bin/app console # Use the Symfony console
bin/app composer # Use Composer inside the app container
bin/app tests # Run test project inside the app container

```
7 changes: 7 additions & 0 deletions app/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
7 changes: 7 additions & 0 deletions app/AppCache.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;

class AppCache extends HttpCache
{
}
57 changes: 57 additions & 0 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = [
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new FOS\RestBundle\FOSRestBundle(),
new JMS\SerializerBundle\JMSSerializerBundle(),
new Snc\RedisBundle\SncRedisBundle(),
new AppBundle\AppBundle(),
];

if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();

if ('dev' === $this->getEnvironment()) {
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
}
}

return $bundles;
}

public function getRootDir()
{
return __DIR__;
}

public function getCacheDir()
{
return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
}

public function getLogDir()
{
return dirname(__DIR__).'/var/logs';
}

public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
}
}
23 changes: 23 additions & 0 deletions app/Resources/views/app.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="{{ app.request.locale }}">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8" />

<title>{% block title %}{% endblock %}</title>

{% block stylesheets %}{% endblock %}

<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
</head>
<body>
{% block data_layout %}
<script type="text/javascript" id="dataLayout">
var dataLayout = {};
</script>
{% endblock %}
{% block body %}{% endblock %}

{% block javascripts %}{% endblock %}
</body>
</html>
94 changes: 94 additions & 0 deletions app/config/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: services.yml }

parameters:
locale: en

framework:
#esi: ~
translator: { fallbacks: ['%locale%'] }
secret: '%secret%'
router:
resource: '%kernel.project_dir%/app/config/routing.yml'
strict_requirements: ~
form: ~
csrf_protection: ~
validation: { enabled: true, enable_annotations: true }
templating:
engines: ['twig']
default_locale: '%locale%'
trusted_hosts: ~
session:
handler_id: snc_redis.session.handler
fragments: ~
http_method_override: true
assets: ~
php_errors:
log: true

# Twig Configuration
twig:
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'

# Doctrine Configuration
doctrine:
dbal:
driver: pdo_pgsql
host: '%database_host%'
port: '%database_port%'
dbname: '%database_name%'
user: '%database_user%'
password: '%database_password%'
charset: UTF8
orm:
auto_generate_proxy_classes: '%kernel.debug%'
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true

# Swiftmailer Configuration
swiftmailer:
transport: '%mailer_transport%'
host: '%mailer_host%'
username: '%mailer_user%'
password: '%mailer_password%'
spool: { type: memory }

# SerializerBundle Configuration
jms_serializer:
metadata:
auto_detection: true

# FOSRestBundle Configuration
fos_rest:
body_converter:
enabled: true
validate: true
serializer:
serialize_null: true
param_fetcher_listener: true
routing_loader:
default_format: json
include_format: false
view:
view_response_listener: true
format_listener:
rules:
- { path: '^/api', priorities: ['json'], fallback_format: 'json' }
- { path: '^/', stop: true }

# RedisBundle Configuration
snc_redis:
clients:
session_client:
type: predis
logging: false
alias: session_client
dsn: %redis_dsn%
options: %redis_options%
session:
client: session_client
prefix: app_session_
ttl: '%session_ttl%'
28 changes: 28 additions & 0 deletions app/config/config_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
imports:
- { resource: config.yml }

framework:
router:
resource: '%kernel.project_dir%/app/config/routing_dev.yml'
strict_requirements: true
profiler: { only_exceptions: false }

web_profiler:
toolbar: true
intercept_redirects: false

monolog:
handlers:
main:
type: stream
path: '%kernel.logs_dir%/%kernel.environment%.log'
level: debug
channels: ['!event']
console:
type: console
process_psr_3_messages: false
channels: ['!event', '!doctrine', '!console']
server_log:
type: server_log
process_psr_3_messages: false
host: 127.0.0.1:9911
16 changes: 16 additions & 0 deletions app/config/config_prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
imports:
- { resource: config.yml }

monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
nested:
type: stream
path: '%kernel.logs_dir%/%kernel.environment%.log'
level: debug
console:
type: console
process_psr_3_messages: false
18 changes: 18 additions & 0 deletions app/config/config_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
imports:
- { resource: config_dev.yml }

framework:
test: ~
session:
handler_id: session.handler.native_file
storage_id: session.storage.mock_file
profiler:
collect: false
cache: ~

web_profiler:
toolbar: false
intercept_redirects: false

swiftmailer:
disable_delivery: true
21 changes: 21 additions & 0 deletions app/config/parameters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
parameters:
# Database parameters
database_host: postgres
database_port: '%env(POSTGRES_PORT)%'
database_name: '%env(POSTGRES_DB)%'
database_user: '%env(POSTGRES_USER)%'
database_password: '%env(POSTGRES_PASSWORD)%'

# Mailer parameters
mailer_transport: %env(SMTP_TRANSPORT)%
mailer_host: '%env(SMTP_HOST)%'
mailer_user: '%env(SMTP_USER)%'
mailer_password: '%env(SMTP_PASSWORD)%'

# Secret
secret: '%env(SECRET)%'

# Redis parameters
redis_dsn: '%env(REDIS_DNS)%'
redis_options: ~
session_ttl: 86400
9 changes: 9 additions & 0 deletions app/config/routing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
app:
resource: AppBundle\Controller\AppController
type: annotation
prefix: /

api:
type: rest
resource: AppBundle\Controller\ApiController
prefix: /api
Loading

0 comments on commit 8ca6775

Please sign in to comment.