Skip to content

Commit

Permalink
feature: add a symfony backend
Browse files Browse the repository at this point in the history
  • Loading branch information
wilcorrea committed Apr 23, 2024
1 parent 7d5b144 commit 3076426
Show file tree
Hide file tree
Showing 13 changed files with 1,770 additions and 20 deletions.
5 changes: 5 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,8 @@ no composer.json que todos os componentes instalados são do Symfony 7.
#### 🚀 Rodando nossa aplicação com o Docker

A documentação oficial do Symfony no direciona para esta página [aqui](https://symfony.com/doc/current/setup/docker.html).


```bash
composer require symfony/maker-bundle --dev
```
12 changes: 11 additions & 1 deletion backend/symfony/.env
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,15 @@

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=df92a81d9a2785ed0ad91e86f4c53f3a
APP_SECRET=52b327be48619969f065504ff5bf617d
###< symfony/framework-bundle ###

###> 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="mysql://app:[email protected]:3306/app?serverVersion=8.0.32&charset=utf8mb4"
# DATABASE_URL="mysql://app:[email protected]:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
DATABASE_URL="postgresql://app:[email protected]:5432/app?serverVersion=16&charset=utf8"
###< doctrine/doctrine-bundle ###
8 changes: 8 additions & 0 deletions backend/symfony/compose.override.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3'

services:
###> doctrine/doctrine-bundle ###
database:
ports:
- "5432"
###< doctrine/doctrine-bundle ###
26 changes: 26 additions & 0 deletions backend/symfony/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3'

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"]
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 ###
5 changes: 5 additions & 0 deletions backend/symfony/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"php": ">=8.2",
"ext-ctype": "*",
"ext-iconv": "*",
"doctrine/dbal": "^3",
"doctrine/doctrine-bundle": "^2.12",
"doctrine/doctrine-migrations-bundle": "^3.3",
"doctrine/orm": "^3.1",
"symfony/console": "7.0.*",
"symfony/dotenv": "7.0.*",
"symfony/flex": "^2",
Expand All @@ -15,6 +19,7 @@
"symfony/yaml": "7.0.*"
},
"require-dev": {
"symfony/maker-bundle": "^1.58"
},
"config": {
"allow-plugins": {
Expand Down
Loading

0 comments on commit 3076426

Please sign in to comment.