Skip to content

dmytro-kuchura/food-shop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


System requirements

For local application starting (for development) make sure that you have locally installed next applications:

  • docker >= 18.0 (install: curl -fsSL get.docker.com | sudo sh)
  • docker-compose >= 1.22 ([installing manual][install_compose])

Used services

This application uses next services:

  • PostgreSQL 14.9
  • PHP 8.1
  • nginx

Declaration of all services can be found into ./docker-compose.yml file.

Work with application

Checkout the repository or download the sources.

Simply run docker-compose up -d and you are done.

Nginx will be available on localhost:80 and PostgreSQL on localhost:5432.

Using Composer

docker-compose run composer <cmd>

Where cmd is any of the available composer command.

Using PostgreSQL

Default connection:

docker-compose exec db psql -U postgres

Using .env file default parameters:

docker-compose exec db psql -U dbuser dbname

If you want to connect to the DB from another container (from the php one for instance), the host will be the service name: db.

Using PHP

You can execute any command on the php container as you would do on any docker-compose container:

docker-compose exec php php -v

Change configuration

Configuring PHP

To change PHP's configuration edit .docker/conf/php/php.ini. Same goes for .docker/conf/php/xdebug.ini.

You can add any .ini file in this directory, don't forget to map them by adding a new line in the php's volume section of the docker-compose.yml file.

Configuring PostgreSQL

If you want to change the db name, db user and db password simply edit the .env file at the project's root.

If you connect to PostgreSQL from localhost a password is not required however from another container you will have to supply it.

Clear cache

docker-compose rm --all
docker-compose pull
docker-compose build --no-cache
docker-compose up -d --force-recreate