https://github.com/alexfer/docker
Docker - Nginx, PHP, Postgres, Elastic, Supevisor and Mercure
https://github.com/alexfer/docker
docker docker-compose elasticsearch mercure nginx php8 postgresql supervisor
Last synced: 5 months ago
JSON representation
Docker - Nginx, PHP, Postgres, Elastic, Supevisor and Mercure
- Host: GitHub
- URL: https://github.com/alexfer/docker
- Owner: alexfer
- License: mit
- Created: 2024-07-14T07:28:15.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-01-21T07:02:19.000Z (5 months ago)
- Last Synced: 2025-02-01T22:01:50.125Z (5 months ago)
- Topics: docker, docker-compose, elasticsearch, mercure, nginx, php8, postgresql, supervisor
- Language: Dockerfile
- Homepage: https://github.com/alexfer
- Size: 2.26 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://vshymanskyy.github.io/StandWithUkraine)
Creating and deploying postgres database
============
> [!IMPORTANT]
> In the docker directory go over:
### Deploy source code```shell
$ cd dev/project/
$ git clone [email protected]:alexfer/inno.git
$ cd inno
$ cp .env.dist .env # symfony configuration
$ composer install
$ npm install
$ npm run dev --watch
````
### Build docker
#### Run following commands and fill .env file:
````shell
$ cd docker
````
#### Fill out .env file:
````shell
$ cp .env.dist .env # docker configuration
$ docker-compose up -d --build
````
### Clear logs
````shell
./clear-logs.sh
````
### Create database & grant privileges to database
Login to postgres container:
````shell
$ docker exec -it postgres sh
psql -U postgres
````
Next step:
````sql
DROP ROLE IF EXISTS inno; -- optional
CREATE USER inno WITH password 'inno';
ALTER USER inno WITH SUPERUSER;
ALTER USER inno CREATEDB;
CREATE DATABASE inno OWNER inno;
GRANT ALL PRIVILEGES ON DATABASE inno TO inno;
````
Deploy database:
````shell
$ docker exec -it php bash
$ cd root_project_dir
$ rm -rfv src/Migrations/* # optional (if migrations exists)
$ php bin/console doctrine:database:drop --if-exists --force # optional
$ php bin/console doctrine:database:create # optional
$ php bin/console make:migration --no-interaction # optional (if migrations doesn't exists)
$ php bin/console doctrine:migrations:migrate --no-interaction
$ php bin/console doctrine:fixtures:load --no-interaction
$ php bin/console app:functions:import --no-interaction
````
Clear database Redis:
````shell
docker exec -it redis redis-cli FLUSHALL
````