diff --git a/build/php/Dockerfile b/build/php/Dockerfile index 1094eac7..21223850 100644 --- a/build/php/Dockerfile +++ b/build/php/Dockerfile @@ -10,6 +10,6 @@ ARG APPLICATION_VERSION ENV APPLICATION_VERSION=${APPLICATION_VERSION} COPY --chown=application ./ ./ COPY .env.production.example .env -COPY settings/supervisor/movary.conf /opt/docker/etc/supervisor.d/movary.conf +COPY settings/supervisor/ /opt/docker/etc/supervisor.d/ RUN composer install --no-dev RUN php bin/console.php storage:link diff --git a/docker-compose.yml b/docker-compose.yml index c3faacb5..1a2ef308 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,6 +9,8 @@ services: - "${HTTP_PORT}:80" volumes: - ./:/app + # - ./settings/supervisor/database-migrate.conf:/opt/docker/etc/supervisor.d/database-migrate.conf + # - ./settings/supervisor/job-processing.conf:/opt/docker/etc/supervisor.d/job-processing.conf environment: PHP_DATE_TIMEZONE: "${TIMEZONE}" diff --git a/docs/configuration.md b/docs/configuration.md index 85cded95..14f14b12 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -32,16 +32,17 @@ The `Web UI` column is set to yes if an environment variable can alternatively b Required to run the application -| NAME | DEFAULT VALUE | INFO | -|:--------------------------|:-----------------------:|:---------------------------------| -| `DATABASE_MODE` | - | **Required** `sqlite` or `mysql` | -| `DATABASE_SQLITE` | `storage/movary.sqlite` | | -| `DATABASE_MYSQL_HOST` | - | Required when mode is `mysql` | -| `DATABASE_MYSQL_PORT` | `3306` | | -| `DATABASE_MYSQL_NAME` | - | Required when mode is `mysql` | -| `DATABASE_MYSQL_USER` | - | Required when mode is `mysql` | -| `DATABASE_MYSQL_PASSWORD` | - | Required when mode is `mysql` | -| `DATABASE_MYSQL_CHARSET` | `utf8mb4` | | +| NAME | DEFAULT VALUE | INFO | +|:----------------------------------|:-----------------------:|:-------------------------------------------------------| +| `DATABASE_MODE` | - | **Required** `sqlite` or `mysql` | +| `DATABASE_SQLITE` | `storage/movary.sqlite` | | +| `DATABASE_MYSQL_HOST` | - | Required when mode is `mysql` | +| `DATABASE_MYSQL_PORT` | `3306` | | +| `DATABASE_MYSQL_NAME` | - | Required when mode is `mysql` | +| `DATABASE_MYSQL_USER` | - | Required when mode is `mysql` | +| `DATABASE_MYSQL_PASSWORD` | - | Required when mode is `mysql` | +| `DATABASE_MYSQL_CHARSET` | `utf8mb4` | | +| `DATABASE_DISABLE_AUTO_MIGRATION` | `0` | On default docker runs migrations on container startup | ### Third party integrations diff --git a/settings/supervisor/database-migrate.conf b/settings/supervisor/database-migrate.conf new file mode 100644 index 00000000..a35ac055 --- /dev/null +++ b/settings/supervisor/database-migrate.conf @@ -0,0 +1,14 @@ +[program:movay-database-migrate] +command=bash -c 'if [ "$DISABLE_DATABASE_AUTO_MIGRATION" != "true" ]; then /usr/local/bin/php /app/bin/console.php database:migration:migrate; else echo "Database migration is disabled"; fi' +numprocs=1 +user=application +autostart=true +autorestart=unexpected +priority=10 +exitcodes=0 +startsecs=0 +startretries=5 +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 \ No newline at end of file diff --git a/settings/supervisor/job-processing.conf b/settings/supervisor/job-processing.conf new file mode 100644 index 00000000..d62ef0f0 --- /dev/null +++ b/settings/supervisor/job-processing.conf @@ -0,0 +1,13 @@ +[program:movay-job-processing] +command=/usr/local/bin/php /app/bin/console.php jobs:process +numprocs=1 +user=application +autostart=true +autorestart=true +priority=20 +startsecs=1 +startretries=10 +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 \ No newline at end of file diff --git a/settings/supervisor/movary.conf b/settings/supervisor/movary.conf deleted file mode 100644 index 611923ad..00000000 --- a/settings/supervisor/movary.conf +++ /dev/null @@ -1,25 +0,0 @@ -[program:movary] -command=/usr/local/bin/php /app/bin/console.php jobs:process -numprocs=1 -user=application -autostart=true -autorestart=true -startsecs=1 -startretries=10 -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:migrations] -command=/usr/local/bin/php /app/bin/console.php database:migration:migrate -numprocs=1 -user=application -autostart=true -autorestart=false -startsecs=1 -startretries=10 -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 \ No newline at end of file