Skip to content
Snippets Groups Projects
Commit e23f49d2 authored by PEREZ-RAMIREZ Julian's avatar PEREZ-RAMIREZ Julian
Browse files

trying to run doctrine

parent f9e7edab
Branches
No related tags found
No related merge requests found
FROM bitnami/symfony:latest
WORKDIR /app
COPY . /app
# Ensure dependencies are installed
RUN composer install --no-interaction --prefer-dist --optimize-autoloader
# Install Doctrine ORM explicitly
RUN composer require symfony/orm-pack --no-scripts --no-interactio
EXPOSE 8000
......@@ -17,8 +17,8 @@ services:
image: mysql:8.1
container_name: symfony_db
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: symfony
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: wishlist_db
MYSQL_USER: symfony
MYSQL_PASSWORD: symfony
ports:
......@@ -34,4 +34,7 @@ services:
depends_on:
- mysql #this line links this container to the db container
environment:
PMA_HOST: mysql
\ No newline at end of file
PMA_HOST: mysql
#If you got an error about folder permissions with innodb_redo,
# try to fix it by running sudo chmod -R 755 ~/<your_path>/wishlist/mysql_data
\ No newline at end of file
{
"require": {
"symfony/orm-pack": "^2.4"
},
"require-dev": {
"symfony/maker-bundle": "^1.62"
}
}
services:
###> doctrine/doctrine-bundle ###
database:
ports:
- "5432"
###< doctrine/doctrine-bundle ###
services:
###> doctrine/doctrine-bundle ###
database:
image: postgres:${POSTGRES_VERSION:-16}-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB:-app}
# You should definitely change the password in production
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}
POSTGRES_USER: ${POSTGRES_USER:-app}
healthcheck:
test: ["CMD", "pg_isready", "-d", "${POSTGRES_DB:-app}", "-U", "${POSTGRES_USER:-app}"]
timeout: 5s
retries: 5
start_period: 60s
volumes:
- database_data:/var/lib/postgresql/data:rw
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/db/data:/var/lib/postgresql/data:rw
###< doctrine/doctrine-bundle ###
volumes:
###> doctrine/doctrine-bundle ###
database_data:
###< doctrine/doctrine-bundle ###
......@@ -7,6 +7,10 @@
"php": ">=8.2",
"ext-ctype": "*",
"ext-iconv": "*",
"doctrine/dbal": "^3",
"doctrine/doctrine-bundle": "^2.13",
"doctrine/doctrine-migrations-bundle": "^3.4",
"doctrine/orm": "^3.3",
"symfony/console": "7.2.*",
"symfony/dotenv": "7.2.*",
"symfony/flex": "^2",
......@@ -14,8 +18,6 @@
"symfony/runtime": "7.2.*",
"symfony/yaml": "7.2.*"
},
"require-dev": {
},
"config": {
"allow-plugins": {
"php-http/discovery": true,
......
......@@ -2,4 +2,6 @@
return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
];
doctrine:
dbal:
url: '%env(resolve:DATABASE_URL)%'
# IMPORTANT: You MUST configure your server version,
# either here or in the DATABASE_URL env var (see .env file)
#server_version: '16'
profiling_collect_backtrace: '%kernel.debug%'
use_savepoints: true
orm:
auto_generate_proxy_classes: true
enable_lazy_ghost_objects: true
report_fields_where_declared: true
validate_xml_mapping: true
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
identity_generation_preferences:
Doctrine\DBAL\Platforms\PostgreSQLPlatform: identity
auto_mapping: true
mappings:
App:
type: attribute
is_bundle: false
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
controller_resolver:
auto_mapping: false
when@test:
doctrine:
dbal:
# "TEST_TOKEN" is typically set by ParaTest
dbname_suffix: '_test%env(default::TEST_TOKEN)%'
when@prod:
doctrine:
orm:
auto_generate_proxy_classes: false
proxy_dir: '%kernel.build_dir%/doctrine/orm/Proxies'
query_cache_driver:
type: pool
pool: doctrine.system_cache_pool
result_cache_driver:
type: pool
pool: doctrine.result_cache_pool
framework:
cache:
pools:
doctrine.result_cache_pool:
adapter: cache.app
doctrine.system_cache_pool:
adapter: cache.system
doctrine_migrations:
migrations_paths:
# namespace is arbitrary but should be different from App\Migrations
# as migrations classes should NOT be autoloaded
'DoctrineMigrations': '%kernel.project_dir%/migrations'
enable_profiler: false
{
"doctrine/doctrine-bundle": {
"version": "2.13",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "2.13",
"ref": "8d96c0b51591ffc26794d865ba3ee7d193438a83"
},
"files": [
"config/packages/doctrine.yaml",
"src/Entity/.gitignore",
"src/Repository/.gitignore"
]
},
"doctrine/doctrine-migrations-bundle": {
"version": "3.4",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "3.1",
"ref": "1d01ec03c6ecbd67c3375c5478c9a423ae5d6a33"
},
"files": [
"config/packages/doctrine_migrations.yaml",
"migrations/.gitignore"
]
},
"symfony/console": {
"version": "7.2",
"recipe": {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment