From 089acdffd9e32748e657ca8a586cd8e50edb9a3d Mon Sep 17 00:00:00 2001 From: Samuel ORTION Date: Tue, 23 Aug 2022 17:15:40 +0200 Subject: [PATCH] docker: Symfony seems to be running (still mysql issues) --- docker-compose.yml | 8 +++++--- docker/database/init/00-init-databases.sql | 5 +++++ docker/database/init/01-databases.sql | 7 ------- docs/DOCKER.md | 6 ++++++ 4 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 docker/database/init/00-init-databases.sql delete mode 100644 docker/database/init/01-databases.sql diff --git a/docker-compose.yml b/docker-compose.yml index e5ade5f..006b27f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -48,6 +48,8 @@ services: environment: - APP_ENV=${APP_ENV:-prod} - APP_DEBUG=${APP_DEBUG:-true} + - DATABASE_DEFAULT_URL=mysql://${DATABASE_USER:-birdnet}:${DATABASE_PASSWORD:-secret}@${DATABASE_HOST:-birdnet_database}:${DATABASE_PORT:-3306}/birdnet_default + - DATABASE_OBSERVATIONS_URL=mysql://${DATABASE_USER:-birdnet}:${DATABASE_PASSWORD:-secret}@${DATABASE_HOST:-birdnet_database}:${DATABASE_PORT:-3306}/birdnet_observations restart: unless-stopped volumes: - birdnet_app:${PROJECT_ROOT:-/opt/birdnet} @@ -61,7 +63,7 @@ services: dockerfile: ./docker/symfony/Dockerfile args: - DATABASE_DEFAULT_URL=mysql://${DATABASE_USER:-birdnet}:${DATABASE_PASSWORD:-secret}@${DATABASE_HOST:-birdnet_database}:${DATABASE_PORT:-3306}/birdnet_default - - DATABASE_OBSERVATIONS_URL=mysql://${DATABASE_USER:-birdnet}:${DATABASE_PASSWORD:-secret}@${DATABASE_HOST:-birdnet_database}:${DATABASE_PORT:-3306}/birdnet_observation + - DATABASE_OBSERVATIONS_URL=mysql://${DATABASE_USER:-birdnet}:${DATABASE_PASSWORD:-secret}@${DATABASE_HOST:-birdnet_database}:${DATABASE_PORT:-3306}/birdnet_observations - RECORDS_DIR=/media/birdnet/records - CHARTS_DIR=/media/birdnet/charts restart: on-failure @@ -85,8 +87,8 @@ services: - PHP_FPM_HOST=birdnet_php-fpm - PHP_FPM_PORT=9000 ports: - - '81:80' - - '444:443' + - ${HTTP_PORT:-80}:80 + - ${HTTPS_PORT:-443}:443 volumes: - birdnet_app:/opt/birdnet - birdnet_records:/media/data/records diff --git a/docker/database/init/00-init-databases.sql b/docker/database/init/00-init-databases.sql new file mode 100644 index 0000000..94d315a --- /dev/null +++ b/docker/database/init/00-init-databases.sql @@ -0,0 +1,5 @@ +CREATE DATABASE IF NOT EXISTS birdnet_default; +CREATE DATABASE IF NOT EXISTS birdnet_observations; + +GRANT ALL ON `birdnet_observations`.* TO 'birdnet'@'%' IDENTIFIED BY 'secret'; +GRANT ALL ON `birdnet_default`.* TO 'birdnet'@'%' IDENTIFIED BY 'secret'; \ No newline at end of file diff --git a/docker/database/init/01-databases.sql b/docker/database/init/01-databases.sql deleted file mode 100644 index 85bbf7c..0000000 --- a/docker/database/init/01-databases.sql +++ /dev/null @@ -1,7 +0,0 @@ -CREATE DATABASE IF NOT EXISTS `birdnet_observations`; -CREATE DATABASE IF NOT EXISTS `birdnet_default`; - -GRANT ALL PRIVILEGES ON birdnet_observations.* TO 'birdnet'@'%'; -GRANT ALL PRIVILEGES ON birdnet_default.* TO 'birdnet'@'%'; - -FLUSH PRIVILEGES; \ No newline at end of file diff --git a/docs/DOCKER.md b/docs/DOCKER.md index 483a598..94fd560 100644 --- a/docs/DOCKER.md +++ b/docs/DOCKER.md @@ -28,6 +28,12 @@ cd ~/Documents/BirdNET-stream git clone -b main https://github.com/UncleSamulus/BirdNET-stream.git . ``` +Then, create your dotenv file and populate it with your own configuration (for instance, generate random passwords and add them to .env credentials): + +```bash +cp .env.example .env +``` + Then, run docker-compose: ```bash