add postgres + orm
Signed-off-by: Superkooka <aymeric.gueracague@gmail.com>
This commit is contained in:
parent
bb28c49150
commit
7e2c6101ba
17
.env.example
17
.env.example
|
|
@ -26,4 +26,19 @@ APP_SHARE_DIR=var/share
|
|||
DEFAULT_URI=http://localhost
|
||||
###< symfony/routing ###
|
||||
|
||||
SPORT_RADAR_APIKEY=
|
||||
###> doctrine/doctrine-bundle ###
|
||||
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
|
||||
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
|
||||
#
|
||||
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
|
||||
# DATABASE_URL="postgres://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8&charset=utf8mb4"
|
||||
DB_DATABASE=match_schedule
|
||||
DB_HOST=postgres
|
||||
DB_PORT=5432
|
||||
DB_USERNAME=postgres
|
||||
DB_PASSWORD=postgres
|
||||
###< doctrine/doctrine-bundle ###
|
||||
|
||||
###> APP ###
|
||||
SPORT_RADAR_APIKEY=
|
||||
###< APP ###
|
||||
10
Makefile
10
Makefile
|
|
@ -6,7 +6,7 @@ TARGET_APP=nhl-schedule:dev
|
|||
.PHONY: build
|
||||
build:
|
||||
DOCKER_BUILDKIT=1 docker build \
|
||||
-f docker/php-cli/Dockerfile \
|
||||
-f docker/php-fpm/Dockerfile \
|
||||
--target dev \
|
||||
-t $(TARGET_APP) \
|
||||
.
|
||||
|
|
@ -15,6 +15,14 @@ build:
|
|||
install:
|
||||
docker-compose -f docker-compose.yaml run --rm nhl-schedule composer install
|
||||
|
||||
.PHONY: db-init
|
||||
db-init:
|
||||
docker-compose run --rm regen-financing-api sh -c "php bin/console doctrine:migrations:migrate -n"
|
||||
|
||||
.PHONY: start
|
||||
start:
|
||||
docker-compose -f docker-compose.yaml up -d
|
||||
|
||||
.PHONY: run
|
||||
run:
|
||||
docker-compose -f docker-compose.yaml run --rm nhl-schedule php bin/console app:get-nhl-schedule
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@
|
|||
"php": ">=8.4",
|
||||
"ext-ctype": "*",
|
||||
"ext-iconv": "*",
|
||||
"doctrine/doctrine-bundle": "^3.1",
|
||||
"doctrine/doctrine-migrations-bundle": "^4.0",
|
||||
"doctrine/orm": "^3.6",
|
||||
"symfony/console": "8.0.*",
|
||||
"symfony/dotenv": "8.0.*",
|
||||
"symfony/flex": "^2",
|
||||
|
|
@ -20,6 +23,7 @@
|
|||
"friendsofphp/php-cs-fixer": "^3.92",
|
||||
"phpstan/phpstan": "^2.1",
|
||||
"symfony/debug-bundle": "8.0.*",
|
||||
"symfony/maker-bundle": "^1.65",
|
||||
"symfony/stopwatch": "8.0.*"
|
||||
},
|
||||
"config": {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -4,4 +4,7 @@ return [
|
|||
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
|
||||
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
|
||||
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true],
|
||||
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
|
||||
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
|
||||
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
doctrine:
|
||||
dbal:
|
||||
dbname: '%env(resolve:DB_DATABASE)%'
|
||||
host: '%env(resolve:DB_HOST)%'
|
||||
port: ~
|
||||
user: '%env(resolve:DB_USERNAME)%'
|
||||
password: '%env(resolve:DB_PASSWORD)%'
|
||||
driver: pdo_pgsql
|
||||
|
||||
server_version: '18'
|
||||
|
||||
profiling_collect_backtrace: '%kernel.debug%'
|
||||
orm:
|
||||
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\Domain\Entity:
|
||||
type: php
|
||||
dir: '%kernel.project_dir%/src/Infrastructure/Persistence/Mapping'
|
||||
is_bundle: false
|
||||
prefix: App\Domain\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:
|
||||
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
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
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
|
||||
|
|
@ -831,12 +831,227 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
|
|||
* dump_destination?: scalar|null, // A stream URL where dumps should be written to. // Default: null
|
||||
* theme?: "dark"|"light", // Changes the color of the dump() output when rendered directly on the templating. "dark" (default) or "light". // Default: "dark"
|
||||
* }
|
||||
* @psalm-type DoctrineConfig = array{
|
||||
* dbal?: array{
|
||||
* default_connection?: scalar|null,
|
||||
* types?: array<string, string|array{ // Default: []
|
||||
* class: scalar|null,
|
||||
* }>,
|
||||
* driver_schemes?: array<string, scalar|null>,
|
||||
* connections?: array<string, array{ // Default: []
|
||||
* url?: scalar|null, // A URL with connection information; any parameter value parsed from this string will override explicitly set parameters
|
||||
* dbname?: scalar|null,
|
||||
* host?: scalar|null, // Defaults to "localhost" at runtime.
|
||||
* port?: scalar|null, // Defaults to null at runtime.
|
||||
* user?: scalar|null, // Defaults to "root" at runtime.
|
||||
* password?: scalar|null, // Defaults to null at runtime.
|
||||
* dbname_suffix?: scalar|null, // Adds the given suffix to the configured database name, this option has no effects for the SQLite platform
|
||||
* application_name?: scalar|null,
|
||||
* charset?: scalar|null,
|
||||
* path?: scalar|null,
|
||||
* memory?: bool,
|
||||
* unix_socket?: scalar|null, // The unix socket to use for MySQL
|
||||
* persistent?: bool, // True to use as persistent connection for the ibm_db2 driver
|
||||
* protocol?: scalar|null, // The protocol to use for the ibm_db2 driver (default to TCPIP if omitted)
|
||||
* service?: bool, // True to use SERVICE_NAME as connection parameter instead of SID for Oracle
|
||||
* servicename?: scalar|null, // Overrules dbname parameter if given and used as SERVICE_NAME or SID connection parameter for Oracle depending on the service parameter.
|
||||
* sessionMode?: scalar|null, // The session mode to use for the oci8 driver
|
||||
* server?: scalar|null, // The name of a running database server to connect to for SQL Anywhere.
|
||||
* default_dbname?: scalar|null, // Override the default database (postgres) to connect to for PostgreSQL connexion.
|
||||
* sslmode?: scalar|null, // Determines whether or with what priority a SSL TCP/IP connection will be negotiated with the server for PostgreSQL.
|
||||
* sslrootcert?: scalar|null, // The name of a file containing SSL certificate authority (CA) certificate(s). If the file exists, the server's certificate will be verified to be signed by one of these authorities.
|
||||
* sslcert?: scalar|null, // The path to the SSL client certificate file for PostgreSQL.
|
||||
* sslkey?: scalar|null, // The path to the SSL client key file for PostgreSQL.
|
||||
* sslcrl?: scalar|null, // The file name of the SSL certificate revocation list for PostgreSQL.
|
||||
* pooled?: bool, // True to use a pooled server with the oci8/pdo_oracle driver
|
||||
* MultipleActiveResultSets?: bool, // Configuring MultipleActiveResultSets for the pdo_sqlsrv driver
|
||||
* instancename?: scalar|null, // Optional parameter, complete whether to add the INSTANCE_NAME parameter in the connection. It is generally used to connect to an Oracle RAC server to select the name of a particular instance.
|
||||
* connectstring?: scalar|null, // Complete Easy Connect connection descriptor, see https://docs.oracle.com/database/121/NETAG/naming.htm.When using this option, you will still need to provide the user and password parameters, but the other parameters will no longer be used. Note that when using this parameter, the getHost and getPort methods from Doctrine\DBAL\Connection will no longer function as expected.
|
||||
* driver?: scalar|null, // Default: "pdo_mysql"
|
||||
* auto_commit?: bool,
|
||||
* schema_filter?: scalar|null,
|
||||
* logging?: bool, // Default: true
|
||||
* profiling?: bool, // Default: true
|
||||
* profiling_collect_backtrace?: bool, // Enables collecting backtraces when profiling is enabled // Default: false
|
||||
* profiling_collect_schema_errors?: bool, // Enables collecting schema errors when profiling is enabled // Default: true
|
||||
* server_version?: scalar|null,
|
||||
* idle_connection_ttl?: int, // Default: 600
|
||||
* driver_class?: scalar|null,
|
||||
* wrapper_class?: scalar|null,
|
||||
* keep_replica?: bool,
|
||||
* options?: array<string, mixed>,
|
||||
* mapping_types?: array<string, scalar|null>,
|
||||
* default_table_options?: array<string, scalar|null>,
|
||||
* schema_manager_factory?: scalar|null, // Default: "doctrine.dbal.default_schema_manager_factory"
|
||||
* result_cache?: scalar|null,
|
||||
* replicas?: array<string, array{ // Default: []
|
||||
* url?: scalar|null, // A URL with connection information; any parameter value parsed from this string will override explicitly set parameters
|
||||
* dbname?: scalar|null,
|
||||
* host?: scalar|null, // Defaults to "localhost" at runtime.
|
||||
* port?: scalar|null, // Defaults to null at runtime.
|
||||
* user?: scalar|null, // Defaults to "root" at runtime.
|
||||
* password?: scalar|null, // Defaults to null at runtime.
|
||||
* dbname_suffix?: scalar|null, // Adds the given suffix to the configured database name, this option has no effects for the SQLite platform
|
||||
* application_name?: scalar|null,
|
||||
* charset?: scalar|null,
|
||||
* path?: scalar|null,
|
||||
* memory?: bool,
|
||||
* unix_socket?: scalar|null, // The unix socket to use for MySQL
|
||||
* persistent?: bool, // True to use as persistent connection for the ibm_db2 driver
|
||||
* protocol?: scalar|null, // The protocol to use for the ibm_db2 driver (default to TCPIP if omitted)
|
||||
* service?: bool, // True to use SERVICE_NAME as connection parameter instead of SID for Oracle
|
||||
* servicename?: scalar|null, // Overrules dbname parameter if given and used as SERVICE_NAME or SID connection parameter for Oracle depending on the service parameter.
|
||||
* sessionMode?: scalar|null, // The session mode to use for the oci8 driver
|
||||
* server?: scalar|null, // The name of a running database server to connect to for SQL Anywhere.
|
||||
* default_dbname?: scalar|null, // Override the default database (postgres) to connect to for PostgreSQL connexion.
|
||||
* sslmode?: scalar|null, // Determines whether or with what priority a SSL TCP/IP connection will be negotiated with the server for PostgreSQL.
|
||||
* sslrootcert?: scalar|null, // The name of a file containing SSL certificate authority (CA) certificate(s). If the file exists, the server's certificate will be verified to be signed by one of these authorities.
|
||||
* sslcert?: scalar|null, // The path to the SSL client certificate file for PostgreSQL.
|
||||
* sslkey?: scalar|null, // The path to the SSL client key file for PostgreSQL.
|
||||
* sslcrl?: scalar|null, // The file name of the SSL certificate revocation list for PostgreSQL.
|
||||
* pooled?: bool, // True to use a pooled server with the oci8/pdo_oracle driver
|
||||
* MultipleActiveResultSets?: bool, // Configuring MultipleActiveResultSets for the pdo_sqlsrv driver
|
||||
* instancename?: scalar|null, // Optional parameter, complete whether to add the INSTANCE_NAME parameter in the connection. It is generally used to connect to an Oracle RAC server to select the name of a particular instance.
|
||||
* connectstring?: scalar|null, // Complete Easy Connect connection descriptor, see https://docs.oracle.com/database/121/NETAG/naming.htm.When using this option, you will still need to provide the user and password parameters, but the other parameters will no longer be used. Note that when using this parameter, the getHost and getPort methods from Doctrine\DBAL\Connection will no longer function as expected.
|
||||
* }>,
|
||||
* }>,
|
||||
* },
|
||||
* orm?: array{
|
||||
* default_entity_manager?: scalar|null,
|
||||
* enable_native_lazy_objects?: bool, // Deprecated: The "enable_native_lazy_objects" option is deprecated and will be removed in DoctrineBundle 4.0, as native lazy objects are now always enabled. // Default: true
|
||||
* controller_resolver?: bool|array{
|
||||
* enabled?: bool, // Default: true
|
||||
* auto_mapping?: bool, // Deprecated: The "auto_mapping" option is deprecated and will be removed in DoctrineBundle 4.0, as it only accepts `false` since 3.0. // Set to true to enable using route placeholders as lookup criteria when the primary key doesn't match the argument name // Default: false
|
||||
* evict_cache?: bool, // Set to true to fetch the entity from the database instead of using the cache, if any // Default: false
|
||||
* },
|
||||
* entity_managers?: array<string, array{ // Default: []
|
||||
* query_cache_driver?: string|array{
|
||||
* type?: scalar|null, // Default: null
|
||||
* id?: scalar|null,
|
||||
* pool?: scalar|null,
|
||||
* },
|
||||
* metadata_cache_driver?: string|array{
|
||||
* type?: scalar|null, // Default: null
|
||||
* id?: scalar|null,
|
||||
* pool?: scalar|null,
|
||||
* },
|
||||
* result_cache_driver?: string|array{
|
||||
* type?: scalar|null, // Default: null
|
||||
* id?: scalar|null,
|
||||
* pool?: scalar|null,
|
||||
* },
|
||||
* entity_listeners?: array{
|
||||
* entities?: array<string, array{ // Default: []
|
||||
* listeners?: array<string, array{ // Default: []
|
||||
* events?: list<array{ // Default: []
|
||||
* type?: scalar|null,
|
||||
* method?: scalar|null, // Default: null
|
||||
* }>,
|
||||
* }>,
|
||||
* }>,
|
||||
* },
|
||||
* connection?: scalar|null,
|
||||
* class_metadata_factory_name?: scalar|null, // Default: "Doctrine\\ORM\\Mapping\\ClassMetadataFactory"
|
||||
* default_repository_class?: scalar|null, // Default: "Doctrine\\ORM\\EntityRepository"
|
||||
* auto_mapping?: scalar|null, // Default: false
|
||||
* naming_strategy?: scalar|null, // Default: "doctrine.orm.naming_strategy.default"
|
||||
* quote_strategy?: scalar|null, // Default: "doctrine.orm.quote_strategy.default"
|
||||
* typed_field_mapper?: scalar|null, // Default: "doctrine.orm.typed_field_mapper.default"
|
||||
* entity_listener_resolver?: scalar|null, // Default: null
|
||||
* fetch_mode_subselect_batch_size?: scalar|null,
|
||||
* repository_factory?: scalar|null, // Default: "doctrine.orm.container_repository_factory"
|
||||
* schema_ignore_classes?: list<scalar|null>,
|
||||
* validate_xml_mapping?: bool, // Set to "true" to opt-in to the new mapping driver mode that was added in Doctrine ORM 2.14 and will be mandatory in ORM 3.0. See https://github.com/doctrine/orm/pull/6728. // Default: false
|
||||
* second_level_cache?: array{
|
||||
* region_cache_driver?: string|array{
|
||||
* type?: scalar|null, // Default: null
|
||||
* id?: scalar|null,
|
||||
* pool?: scalar|null,
|
||||
* },
|
||||
* region_lock_lifetime?: scalar|null, // Default: 60
|
||||
* log_enabled?: bool, // Default: true
|
||||
* region_lifetime?: scalar|null, // Default: 3600
|
||||
* enabled?: bool, // Default: true
|
||||
* factory?: scalar|null,
|
||||
* regions?: array<string, array{ // Default: []
|
||||
* cache_driver?: string|array{
|
||||
* type?: scalar|null, // Default: null
|
||||
* id?: scalar|null,
|
||||
* pool?: scalar|null,
|
||||
* },
|
||||
* lock_path?: scalar|null, // Default: "%kernel.cache_dir%/doctrine/orm/slc/filelock"
|
||||
* lock_lifetime?: scalar|null, // Default: 60
|
||||
* type?: scalar|null, // Default: "default"
|
||||
* lifetime?: scalar|null, // Default: 0
|
||||
* service?: scalar|null,
|
||||
* name?: scalar|null,
|
||||
* }>,
|
||||
* loggers?: array<string, array{ // Default: []
|
||||
* name?: scalar|null,
|
||||
* service?: scalar|null,
|
||||
* }>,
|
||||
* },
|
||||
* hydrators?: array<string, scalar|null>,
|
||||
* mappings?: array<string, bool|string|array{ // Default: []
|
||||
* mapping?: scalar|null, // Default: true
|
||||
* type?: scalar|null,
|
||||
* dir?: scalar|null,
|
||||
* alias?: scalar|null,
|
||||
* prefix?: scalar|null,
|
||||
* is_bundle?: bool,
|
||||
* }>,
|
||||
* dql?: array{
|
||||
* string_functions?: array<string, scalar|null>,
|
||||
* numeric_functions?: array<string, scalar|null>,
|
||||
* datetime_functions?: array<string, scalar|null>,
|
||||
* },
|
||||
* filters?: array<string, string|array{ // Default: []
|
||||
* class: scalar|null,
|
||||
* enabled?: bool, // Default: false
|
||||
* parameters?: array<string, mixed>,
|
||||
* }>,
|
||||
* identity_generation_preferences?: array<string, scalar|null>,
|
||||
* }>,
|
||||
* resolve_target_entities?: array<string, scalar|null>,
|
||||
* },
|
||||
* }
|
||||
* @psalm-type DoctrineMigrationsConfig = array{
|
||||
* enable_service_migrations?: bool, // Whether to enable fetching migrations from the service container. // Default: false
|
||||
* migrations_paths?: array<string, scalar|null>,
|
||||
* services?: array<string, scalar|null>,
|
||||
* factories?: array<string, scalar|null>,
|
||||
* storage?: array{ // Storage to use for migration status metadata.
|
||||
* table_storage?: array{ // The default metadata storage, implemented as a table in the database.
|
||||
* table_name?: scalar|null, // Default: null
|
||||
* version_column_name?: scalar|null, // Default: null
|
||||
* version_column_length?: scalar|null, // Default: null
|
||||
* executed_at_column_name?: scalar|null, // Default: null
|
||||
* execution_time_column_name?: scalar|null, // Default: null
|
||||
* },
|
||||
* },
|
||||
* migrations?: list<scalar|null>,
|
||||
* connection?: scalar|null, // Connection name to use for the migrations database. // Default: null
|
||||
* em?: scalar|null, // Entity manager name to use for the migrations database (available when doctrine/orm is installed). // Default: null
|
||||
* all_or_nothing?: scalar|null, // Run all migrations in a transaction. // Default: false
|
||||
* check_database_platform?: scalar|null, // Adds an extra check in the generated migrations to allow execution only on the same platform as they were initially generated on. // Default: true
|
||||
* custom_template?: scalar|null, // Custom template path for generated migration classes. // Default: null
|
||||
* organize_migrations?: scalar|null, // Organize migrations mode. Possible values are: "BY_YEAR", "BY_YEAR_AND_MONTH", false // Default: false
|
||||
* enable_profiler?: bool, // Whether or not to enable the profiler collector to calculate and visualize migration status. This adds some queries overhead. // Default: false
|
||||
* transactional?: bool, // Whether or not to wrap migrations in a single transaction. // Default: true
|
||||
* }
|
||||
* @psalm-type MakerConfig = array{
|
||||
* root_namespace?: scalar|null, // Default: "App"
|
||||
* generate_final_classes?: bool, // Default: true
|
||||
* generate_final_entities?: bool, // Default: false
|
||||
* }
|
||||
* @psalm-type ConfigType = array{
|
||||
* imports?: ImportsConfig,
|
||||
* parameters?: ParametersConfig,
|
||||
* services?: ServicesConfig,
|
||||
* framework?: FrameworkConfig,
|
||||
* monolog?: MonologConfig,
|
||||
* doctrine?: DoctrineConfig,
|
||||
* doctrine_migrations?: DoctrineMigrationsConfig,
|
||||
* "when@dev"?: array{
|
||||
* imports?: ImportsConfig,
|
||||
* parameters?: ParametersConfig,
|
||||
|
|
@ -844,6 +1059,9 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
|
|||
* framework?: FrameworkConfig,
|
||||
* monolog?: MonologConfig,
|
||||
* debug?: DebugConfig,
|
||||
* doctrine?: DoctrineConfig,
|
||||
* doctrine_migrations?: DoctrineMigrationsConfig,
|
||||
* maker?: MakerConfig,
|
||||
* },
|
||||
* "when@prod"?: array{
|
||||
* imports?: ImportsConfig,
|
||||
|
|
@ -851,6 +1069,8 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
|
|||
* services?: ServicesConfig,
|
||||
* framework?: FrameworkConfig,
|
||||
* monolog?: MonologConfig,
|
||||
* doctrine?: DoctrineConfig,
|
||||
* doctrine_migrations?: DoctrineMigrationsConfig,
|
||||
* },
|
||||
* "when@test"?: array{
|
||||
* imports?: ImportsConfig,
|
||||
|
|
@ -858,6 +1078,8 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
|
|||
* services?: ServicesConfig,
|
||||
* framework?: FrameworkConfig,
|
||||
* monolog?: MonologConfig,
|
||||
* doctrine?: DoctrineConfig,
|
||||
* doctrine_migrations?: DoctrineMigrationsConfig,
|
||||
* },
|
||||
* ...<string, ExtensionType|array{ // extra keys must follow the when@%env% pattern or match an extension alias
|
||||
* imports?: ImportsConfig,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,17 @@ services:
|
|||
- .env
|
||||
volumes:
|
||||
- ./:/var/www:rw,cached
|
||||
- ./docker/php-cli/ini/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini
|
||||
- ./docker/php-cli/ini/local.ini:/usr/local/etc/php/conf.d/local.ini
|
||||
extra_hosts:
|
||||
- host.docker.internal:host-gateway
|
||||
- ./docker/php-fpm/ini/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini
|
||||
- ./docker/php-fpm/ini/local.ini:/usr/local/etc/php/conf.d/local.ini
|
||||
# extra_hosts:
|
||||
# - host.docker.internal:host-gateway
|
||||
|
||||
postgres:
|
||||
image: postgres:18.1
|
||||
volumes:
|
||||
- ./docker/postgres/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
|
||||
environment:
|
||||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_PASSWORD=postgres
|
||||
ports:
|
||||
- '5432:5432'
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
CREATE DATABASE match_schedule;
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
[www]
|
||||
pm.max_children = 10
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
ARG PHP_VERSION=8.5
|
||||
|
||||
FROM php:${PHP_VERSION}-cli-alpine AS prod
|
||||
FROM php:${PHP_VERSION}-fpm-alpine AS prod
|
||||
|
||||
ARG UID=1000
|
||||
ARG GID=1000
|
||||
|
|
@ -10,6 +10,10 @@ ENV GID=${GID}
|
|||
|
||||
WORKDIR /var/www
|
||||
|
||||
RUN apk add postgresql postgresql-dev \
|
||||
&& docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
|
||||
&& docker-php-ext-install pdo pdo_pgsql pgsql
|
||||
|
||||
RUN apk add --no-cache \
|
||||
acl \
|
||||
fcgi \
|
||||
|
|
@ -55,7 +59,10 @@ RUN set -eux; \
|
|||
\
|
||||
apk del .build-deps
|
||||
|
||||
CMD ["php", "bin/console", "app:get-nhl-schedule"]
|
||||
COPY docker/php-fpm/ini/prod.ini /usr/local/etc/php/conf.d/local.ini
|
||||
COPY docker/php-fpm/99-www-override.conf /usr/local/etc/php-fpm.d/99-www-override.conf
|
||||
|
||||
CMD ["php-fpm", "--nodaemonize"]
|
||||
|
||||
ENV PATH="${PATH}:/root/.composer/vendor/bin"
|
||||
COPY --from=composer:2.9.2 /usr/bin/composer /usr/bin/composer
|
||||
|
|
@ -70,6 +77,7 @@ RUN set -eux; \
|
|||
|
||||
COPY src /var/www/src
|
||||
COPY bin /var/www/bin
|
||||
COPY migrations /var/www/migrations
|
||||
COPY config /var/www/config
|
||||
COPY public /var/www/public
|
||||
|
||||
|
|
@ -102,6 +110,7 @@ RUN apk del linux-headers pcre-dev ${PHPIZE_DEPS}
|
|||
|
||||
USER www
|
||||
|
||||
# COPY .php-cs-fixer.php /var/www/.php-cs-fixer.php
|
||||
# COPY phpstan.neon /var/www/phpstan.neon
|
||||
COPY .php-cs-fixer.php /var/www/.php-cs-fixer.php
|
||||
COPY phpstan.neon /var/www/phpstan.neon
|
||||
|
||||
RUN composer install
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
; PHP MEMORY LIMIT
|
||||
memory_limit = -1
|
||||
|
||||
; PHP MAX UPLOAD SIZE
|
||||
upload_max_filesize = 20M
|
||||
post_max_size = 20M
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
; PHP MAX UPLOAD SIZE
|
||||
upload_max_filesize = 20M
|
||||
post_max_size = 20M
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
zend_extension=xdebug
|
||||
xdebug.mode=debug
|
||||
xdebug.client_host=host.docker.internal
|
||||
xdebug.start_with_request=yes
|
||||
xdebug.idekey=match-schedule
|
||||
xdebug.log=/dev/null
|
||||
45
symfony.lock
45
symfony.lock
|
|
@ -1,4 +1,40 @@
|
|||
{
|
||||
"doctrine/deprecations": {
|
||||
"version": "1.1",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "1.0",
|
||||
"ref": "87424683adc81d7dc305eefec1fced883084aab9"
|
||||
}
|
||||
},
|
||||
"doctrine/doctrine-bundle": {
|
||||
"version": "3.1",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "3.0",
|
||||
"ref": "18ee08e513ba0303fd09a01fc1c934870af06ffa"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/doctrine.yaml",
|
||||
"src/Entity/.gitignore",
|
||||
"src/Repository/.gitignore"
|
||||
]
|
||||
},
|
||||
"doctrine/doctrine-migrations-bundle": {
|
||||
"version": "4.0",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "3.1",
|
||||
"ref": "1d01ec03c6ecbd67c3375c5478c9a423ae5d6a33"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/doctrine_migrations.yaml",
|
||||
"migrations/.gitignore"
|
||||
]
|
||||
},
|
||||
"friendsofphp/php-cs-fixer": {
|
||||
"version": "3.92",
|
||||
"recipe": {
|
||||
|
|
@ -80,6 +116,15 @@
|
|||
".editorconfig"
|
||||
]
|
||||
},
|
||||
"symfony/maker-bundle": {
|
||||
"version": "1.65",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "1.0",
|
||||
"ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f"
|
||||
}
|
||||
},
|
||||
"symfony/monolog-bundle": {
|
||||
"version": "4.0",
|
||||
"recipe": {
|
||||
|
|
|
|||
Loading…
Reference in New Issue