Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexfer/docker
Docker - Nginx, PHP, Postgres, Elastic, Supevisor and Nodejs
https://github.com/alexfer/docker
docker docker-compose elasticsearch nginx node-js php8 postgresql supervisor websockets
Last synced: about 1 month ago
JSON representation
Docker - Nginx, PHP, Postgres, Elastic, Supevisor and Nodejs
- Host: GitHub
- URL: https://github.com/alexfer/docker
- Owner: alexfer
- License: mit
- Created: 2024-07-14T07:28:15.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-20T04:00:39.000Z (about 2 months ago)
- Last Synced: 2024-09-29T05:04:41.279Z (about 2 months ago)
- Topics: docker, docker-compose, elasticsearch, nginx, node-js, php8, postgresql, supervisor, websockets
- Language: Dockerfile
- Homepage: https://github.com/alexfer
- Size: 2.27 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](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/rgfly.git
$ cd rgfly
$ cp .env.dist .env # symfony configuration
$ composer install
$ npm install
$ npm run dev --watch
````
### Deploy Websocket server
```shell
$ cd dev/project/
$ git clone [email protected]:alexfer/nodejs.git
$ cd nodejs
$ cp .env.dist .env # node configuration
$ npm install
````### Build docker
#### Run following commands and fill .env file:
````shell
$ cd docker
````
#### Fill out .env file:
````shell
$ cp .env.dist .env
$ 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 rgfly; -- optional
CREATE USER rgfly WITH password 'rgfly';
ALTER USER rgfly WITH SUPERUSER;
ALTER USER rgfly CREATEDB;
CREATE DATABASE rgfly OWNER rgfly;
GRANT ALL PRIVILEGES ON DATABASE rgfly TO rgfly;
````
Deploy database:
````shell
$ docker exec -it php bash
$ cd rgfly
$ rm -rfv src/Migrations/* # optional
$ 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
$ 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
````