docker: Symfony webapp seems to work (no database connection yet)
This commit is contained in:
parent
c1af47eb26
commit
a557723b35
2
.env
2
.env
@ -7,6 +7,6 @@ DATABASE_PASSWORD="AShoo1N"
|
|||||||
DATABASE_PORT="3306" # Change this if you have already a running MySQL server on the host
|
DATABASE_PORT="3306" # Change this if you have already a running MySQL server on the host
|
||||||
DATABASE_ROOT_PASSWORD="Ojiex5v"
|
DATABASE_ROOT_PASSWORD="Ojiex5v"
|
||||||
|
|
||||||
RECORDS_FOLDER=/media/DATA/birdnet/records/
|
RECORDS_DIR=/media/DATA/birdnet/records/
|
||||||
CHARTS_FOLDER=/media/DATA/birdnet/charts/
|
CHARTS_FOLDER=/media/DATA/birdnet/charts/
|
||||||
SERVER_NAME="birdnet.local"
|
SERVER_NAME="birdnet.local"
|
@ -7,6 +7,6 @@ DATABASE_PASSWORD="secret" # change this
|
|||||||
DATABASE_PORT="3306" # change this if you have already a running MySQL server on the host
|
DATABASE_PORT="3306" # change this if you have already a running MySQL server on the host
|
||||||
MYSQL_ROOT_PASSWORD="secret" # change this
|
MYSQL_ROOT_PASSWORD="secret" # change this
|
||||||
|
|
||||||
RECORDS_FOLDER="/media/data/birdnet/records"
|
RECORDS_DIR="/media/data/birdnet/records"
|
||||||
CHARTS_FOLDER="/media/data/birdnet/charts"
|
CHARTS_DIR="/media/data/birdnet/charts"
|
||||||
SERVER_NAME="birdnet.local"
|
SERVER_NAME="birdnet.local"
|
@ -1,5 +1,7 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v0.0.1-alpha
|
||||||
|
|
||||||
## v0.0.1-rc
|
## v0.0.1-rc
|
||||||
|
|
||||||
- Integrate BirdNET-Analyzer as submodule
|
- Integrate BirdNET-Analyzer as submodule
|
||||||
|
@ -10,7 +10,7 @@ services:
|
|||||||
# environment:
|
# environment:
|
||||||
# - CHUNK_FOLDER=${CHUNK_FOLDER:-/media/birdnet/records}
|
# - CHUNK_FOLDER=${CHUNK_FOLDER:-/media/birdnet/records}
|
||||||
# volumes:
|
# volumes:
|
||||||
# - ${RECORDS_FOLDER:-/media/birdnet/records}:${RECORS_FOLDER:-/media/birdnet/records}
|
# - ${RECORDS_DIR:-/media/birdnet/records}:${RECORS_FOLDER:-/media/birdnet/records}
|
||||||
# # Allow container to access to the hosts microphone
|
# # Allow container to access to the hosts microphone
|
||||||
# devices:
|
# devices:
|
||||||
# - /dev/snd:/dev/snd
|
# - /dev/snd:/dev/snd
|
||||||
@ -41,7 +41,7 @@ services:
|
|||||||
container_name: birdnet_php-fpm
|
container_name: birdnet_php-fpm
|
||||||
image: php:${PHP_VERSION:-8.1}-fpm
|
image: php:${PHP_VERSION:-8.1}-fpm
|
||||||
ports:
|
ports:
|
||||||
- ${PHP_FPM_PORT:-9000}:9000
|
- '9000:9000'
|
||||||
networks:
|
networks:
|
||||||
birdnet_network:
|
birdnet_network:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
@ -58,32 +58,33 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- DATABASE_DEFAULT_URL=${DATABASE_DEFAULT_URL:-mysql://${DATABASE_USER:-birdnet}:${DATABASE_PASSWORD:-secret}@${DATABASE_HOST:-db}:3306/birdnet_default}
|
- DATABASE_DEFAULT_URL=${DATABASE_DEFAULT_URL:-mysql://${DATABASE_USER:-birdnet}:${DATABASE_PASSWORD:-secret}@${DATABASE_HOST:-db}:3306/birdnet_default}
|
||||||
- DATABASE_OBSERVATION_URL=${DATABASE_OBSERVATION_URL:-mysql://${DATABASE_USER:-birdnet}:${DATABASE_PASSWORD:-secret}@${DATABASE_HOST:-db}:3306/birdnet_observation}
|
- DATABASE_OBSERVATION_URL=${DATABASE_OBSERVATION_URL:-mysql://${DATABASE_USER:-birdnet}:${DATABASE_PASSWORD:-secret}@${DATABASE_HOST:-db}:3306/birdnet_observation}
|
||||||
- RECORDS_FOLDER=${RECORDS_FOLDER:-/media/birdnet/records}
|
- RECORDS_DIR=/media/birdnet/records
|
||||||
restart: unless-stopped
|
restart: on-failure
|
||||||
volumes:
|
volumes:
|
||||||
- birdnet_app:${PROJECT_ROOT:-/opt/birdnet}
|
- birdnet_app:${PROJECT_ROOT:-/opt/birdnet}
|
||||||
- birdnet_recordings:${RECORDS_FOLDER:-/media/birdnet/records}
|
- birdnet_records:${RECORDS_DIR:-/media/birdnet/records}
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
container_name: birdnet_nginx
|
container_name: birdnet_nginx
|
||||||
|
hostname: ${SERVER_NAME:-birdnet.local}
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: ./docker/nginx/Dockerfile
|
dockerfile: ./docker/nginx/Dockerfile
|
||||||
args:
|
args:
|
||||||
- SERVER_NAME=${SERVER_NAME:-birnet.local}
|
- SERVER_NAME=${SERVER_NAME:-birnet.local}
|
||||||
- SYMFONY_PUBLIC=${SYMFONY_PUBLIC:-/opt/birdnet/www/public}
|
- SYMFONY_PUBLIC=/opt/birdnet/www/public
|
||||||
- CHARTS_FOLDER=${CHARTS_FOLDER:-/media/birdnet/charts}
|
- CHARTS_DIR=/media/birdnet/charts
|
||||||
- RECORDS_FOLDER=${RECORDS_FOLDER:-/media/birdnet/records}
|
- RECORDS_DIR=/media/birdnet/records
|
||||||
- PHP_FPM_HOST=${PHP_FPM_HOST:-php-fpm}
|
- PHP_FPM_HOST=php-fpm
|
||||||
- PHP_FPM_PORT=${PHP_FPM_PORT:-9000}
|
- PHP_FPM_PORT=9000
|
||||||
ports:
|
ports:
|
||||||
- '80:80'
|
- '80:80'
|
||||||
- '443:443'
|
- '443:443'
|
||||||
volumes:
|
volumes:
|
||||||
- birdnet_app:${RECORDS_FOLDER-/opt/birdnet}
|
- birdnet_app:/opt/birdnet
|
||||||
- birdnet_recordings:${RECORDS_FOLDER-/media/data/records}
|
- birdnet_records:/media/data/records
|
||||||
networks:
|
networks:
|
||||||
birdnet_network:
|
birdnet_network:
|
||||||
ipv4_address: ${IP_ADDRESS:-172.25.0.101}
|
ipv4_address: ${IP_ADDRESS:-172.25.0.101}
|
||||||
@ -103,8 +104,8 @@ networks:
|
|||||||
volumes:
|
volumes:
|
||||||
birdnet_app:
|
birdnet_app:
|
||||||
|
|
||||||
birdnet_recordings:
|
birdnet_records:
|
||||||
driver_opts:
|
driver_opts:
|
||||||
type: none
|
type: none
|
||||||
device: ${RECORDS_FOLDER:-/media/data/records}
|
device: ${RECORDS_DIR:-/media/data/records}
|
||||||
o: bind
|
o: bind
|
@ -3,8 +3,8 @@ FROM nginx
|
|||||||
ARG SERVER_NAME
|
ARG SERVER_NAME
|
||||||
ARG PROJECT_ROOT
|
ARG PROJECT_ROOT
|
||||||
ARG SYMFONY_PUBLIC
|
ARG SYMFONY_PUBLIC
|
||||||
ARG CHARTS_FOLDER
|
ARG CHARTS_DIR
|
||||||
ARG RECORDS_FOLDER
|
ARG RECORDS_DIR
|
||||||
ARG PHP_FPM_HOST
|
ARG PHP_FPM_HOST
|
||||||
ARG PHP_FPM_PORT
|
ARG PHP_FPM_PORT
|
||||||
|
|
||||||
@ -18,8 +18,8 @@ RUN sed -i "s|<SERVER_NAME>|${SERVER_NAME}|g" /etc/nginx/sites-available/birdnet
|
|||||||
&& sed -i "s|<PHP_FPM_HOST>|${PHP_FPM_HOST}|g" /etc/nginx/sites-available/birdnet.conf \
|
&& sed -i "s|<PHP_FPM_HOST>|${PHP_FPM_HOST}|g" /etc/nginx/sites-available/birdnet.conf \
|
||||||
&& sed -i "s|<PHP_FPM_PORT>|${PHP_FPM_PORT}|g" /etc/nginx/sites-available/birdnet.conf \
|
&& sed -i "s|<PHP_FPM_PORT>|${PHP_FPM_PORT}|g" /etc/nginx/sites-available/birdnet.conf \
|
||||||
&& sed -i "s|<SYMFONY_PUBLIC>|${SYMFONY_PUBLIC}|g" /etc/nginx/sites-available/birdnet.conf \
|
&& sed -i "s|<SYMFONY_PUBLIC>|${SYMFONY_PUBLIC}|g" /etc/nginx/sites-available/birdnet.conf \
|
||||||
&& sed -i "s|<RECORDS_FOLDER>|${RECORDS_FOLDER}|g" /etc/nginx/sites-available/birdnet.conf \
|
&& sed -i "s|<RECORDS_DIR>|${RECORDS_DIR}|g" /etc/nginx/sites-available/birdnet.conf \
|
||||||
&& sed -i "s|<CHARTS_FOLDER>|${CHARTS_FOLDER}|g" /etc/nginx/sites-available/birdnet.conf
|
&& sed -i "s|<CHARTS_DIR>|${CHARTS_DIR}|g" /etc/nginx/sites-available/birdnet.conf
|
||||||
RUN mkdir -p /etc/nginx/certs/birdnet
|
RUN mkdir -p /etc/nginx/certs/birdnet
|
||||||
WORKDIR /etc/nginx/certs/birdnet
|
WORKDIR /etc/nginx/certs/birdnet
|
||||||
RUN openssl req -x509 -newkey rsa:4096 -keyout privkey.pem -out fullchain.pem -sha256 -days 365 -nodes --subj "/CN=${SERVER_NAME}"
|
RUN openssl req -x509 -newkey rsa:4096 -keyout privkey.pem -out fullchain.pem -sha256 -days 365 -nodes --subj "/CN=${SERVER_NAME}"
|
||||||
|
@ -32,12 +32,12 @@ server {
|
|||||||
|
|
||||||
location ^~ /media/records {
|
location ^~ /media/records {
|
||||||
autoindex on;
|
autoindex on;
|
||||||
alias <RECORDS_FOLDER>;
|
alias <RECORDS_DIR>;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ^~ /media/charts {
|
location ^~ /media/charts {
|
||||||
autoindex on;
|
autoindex on;
|
||||||
alias <CHARTS_FOLDER>;
|
alias <CHARTS_DIR>;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
|
@ -166,8 +166,8 @@ setup_http_server() {
|
|||||||
debug "Info: Please edit /etc/nginx/sites-available/birdnet-stream.conf to set the correct server name and paths"
|
debug "Info: Please edit /etc/nginx/sites-available/birdnet-stream.conf to set the correct server name and paths"
|
||||||
debug "Setup nginx variables the best way possible"
|
debug "Setup nginx variables the best way possible"
|
||||||
sudo sed -i "s|<SYMFONY_PUBLIC>|$WORKDIR/www/public/|g" /etc/nginx/sites-available/birdnet-stream.conf
|
sudo sed -i "s|<SYMFONY_PUBLIC>|$WORKDIR/www/public/|g" /etc/nginx/sites-available/birdnet-stream.conf
|
||||||
sudo sed -i "s|<RECORDS_FOLDER>|$CHUNK_FOLDER/out|g" /etc/nginx/sites-available/birdnet-stream.conf
|
sudo sed -i "s|<RECORDS_DIR>|$CHUNK_FOLDER/out|g" /etc/nginx/sites-available/birdnet-stream.conf
|
||||||
sudo sed -i "s|<CHARTS_FOLDER>|$WORKDIR/var/charts|g" /etc/nginx/sites-available/birdnet-stream.conf
|
sudo sed -i "s|<CHARTS_DIR>|$WORKDIR/var/charts|g" /etc/nginx/sites-available/birdnet-stream.conf
|
||||||
debug "Generate self signed certificate"
|
debug "Generate self signed certificate"
|
||||||
CERTS_LOCATION="/etc/nginx/certs/birdnet"
|
CERTS_LOCATION="/etc/nginx/certs/birdnet"
|
||||||
sudo mkdir -p "$CERTS_LOCATION"
|
sudo mkdir -p "$CERTS_LOCATION"
|
||||||
|
@ -32,12 +32,12 @@ server {
|
|||||||
|
|
||||||
location ^~ /media/records {
|
location ^~ /media/records {
|
||||||
autoindex on;
|
autoindex on;
|
||||||
alias <RECORDS_FOLDER>;
|
alias <RECORDS_DIR>;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ^~ /media/charts {
|
location ^~ /media/charts {
|
||||||
autoindex on;
|
autoindex on;
|
||||||
alias <CHARTS_FOLDER>;
|
alias <CHARTS_DIR>;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
|
Loading…
Reference in New Issue
Block a user