gns / symfony-rest-api-template
A symfony 4.4 + docker compose project template to make creating new REST API projects easier.
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 2
Language:JavaScript
Type:template
This package is auto-updated.
Last update: 2025-04-29 01:06:58 UTC
README
Installation
-
Create a
.env
from the.env.dist
file. Adapt it according to your symfony applicationcp .env.dist .env
-
Build/run containers with (with and without detached mode)
$ docker-compose build $ docker-compose up -d
-
Update your system host file (add honey_moon.local)
-
Set $SYMFONY_APP_PATH (inside .env full path to symfony dir)
-
Prepare Symfony app
5.1. Composer install & create database
```bash $ docker-compose exec php bash $ composer install $ sf doctrine:database:create $ sf doctrine:schema:update --force # Only if you have `doctrine/doctrine-fixtures-bundle` installed $ sf doctrine:fixtures:load --no-interaction ```
-
Enjoy :-)
Useful commands
-
Build assembly
docker-compose build
-
Run assembly
docker-compose up -d
-
Run assembly except node container
docker-compose run --rm start_dependencies
-
Stop assembly
docker-compose stop
-
To enter php container
$docker-compose exec php bash
sf
alias configured forphp bin/console
-
Run supervisor:
supervisord -c /etc/supervisor/conf.d/private_island.conf
-
Stop supervisor:
kill -s SIGTERM "$(< /tmp/supervisord.pid)"