Skip to content

Commit

Permalink
Merge pull request #624 from leepeuker/refactor-supervisor-config
Browse files Browse the repository at this point in the history
Refactor supervisor config
  • Loading branch information
leepeuker authored Dec 27, 2024
2 parents 2e692e3 + e6cbe55 commit fa06eed
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 36 deletions.
2 changes: 1 addition & 1 deletion build/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
21 changes: 11 additions & 10 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 14 additions & 0 deletions settings/supervisor/database-migrate.conf
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions settings/supervisor/job-processing.conf
Original file line number Diff line number Diff line change
@@ -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
25 changes: 0 additions & 25 deletions settings/supervisor/movary.conf

This file was deleted.

0 comments on commit fa06eed

Please sign in to comment.