Add some deployment instructions, and update the schema when starting the PHP container

This commit is contained in:
Lewis Dale 2024-11-15 11:42:28 +00:00
parent dc76405ba9
commit 1fc58b8c0c
2 changed files with 22 additions and 1 deletions

View File

@ -25,3 +25,13 @@ It's called Baleen, because that's what whales use to filter out the krill from
## Running tests ## Running tests
1. Run `php vendor/bin/phpunit` to run the tests 1. Run `php vendor/bin/phpunit` to run the tests
## Running in Docker
There is a supplied `compose.yml`, so you can run the entire application with `docker compose up -d`, which will create the database and schema, and run an Nginx server.
To add a feed, get the docker container ID of the PHP container using `docker ps`, and then use the `create feed` command:
```bash
docker exec fe0bae104040 sh -c 'php bin/doctrine test:feed --filter=include --target=title -a "[No Ads]" -- "<feed url>" "DnD: Just the eps"'
```

View File

@ -18,6 +18,11 @@ services:
POSTGRES_USER: postgres POSTGRES_USER: postgres
POSTGRES_PASSWORD: password POSTGRES_PASSWORD: password
POSTGRES_DB: baleen POSTGRES_DB: baleen
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "baleen"]
start_period: 20s
retries: 5
interval: 10s
php: php:
build: build:
context: . context: .
@ -31,3 +36,9 @@ services:
- ./bin:/var/www/html/bin - ./bin:/var/www/html/bin
environment: environment:
DB_CONNECTION: postgres://postgres:password@postgres:5432/baleen DB_CONNECTION: postgres://postgres:password@postgres:5432/baleen
entrypoint: sh -c "php bin/doctrine orm:schema-tool:update --complete --force && php-fpm"
depends_on:
postgres:
condition: service_healthy
links:
- postgres