stretinsky / test_task_symfony6.2.0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation

  1. Create a .env file from .env.dist

    $ cp .env.dist .env && nano .env
    $ cd app && cp .env.dist .env
  2. Build and run the stack in detached mode (stop any system's ngixn/apache2 service first)

    $ docker-compose build
    $ docker-compose up -d
  3. Prepare the Symfony application

    1. Update Symfony env variables (.env)

      #...
      DATABASE_URL=mysql://db_user:db_password@mysql:3306/db_name
      #...
      
    2. Composer install & update the schema from the container, execute migrations

      $ docker-compose exec php-fpm bash
      $ composer install
      $ bin/console doctrine:schema:update --force
      $ bin/console doctrine:migrations:migrate
    3. Generate the SSL keys

      $ bin/console lexik:jwt:generate-keypair

Now we can stop our stack with docker-compose down and start it again with docker-compose up -d

Usage

Once all the containers are up, our services are available at:

  • Symfony app: localhost:8081
  • Front: localhost:8081\index.html
  • PhpMyAdmin: localhost:8080

Getting user authorization token from the console

```sh
$ docker-compose exec php-fpm bash
$ bin/console app:token username password
```

About


Languages

Language:PHP 76.3%Language:JavaScript 19.0%Language:HTML 1.8%Language:Twig 1.7%Language:Dockerfile 1.0%Language:CSS 0.2%