onbekende flag 4

This commit is contained in:
Frank
2026-01-11 15:28:40 +01:00
parent 3b3cb69aa7
commit 09f9abcfb8
6 changed files with 25 additions and 25 deletions

2
.env
View File

@@ -44,7 +44,7 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
###< symfony/messenger ### ###< symfony/messenger ###
###> symfony/mailer ### ###> symfony/mailer ###
# Development: use Mailpit (docker compose override provides service `mailer` on port 1025) # Development: use Mailpit (docker-compose override provides service `mailer` on port 1025)
MAILER_DSN=smtp://mailer:1025 MAILER_DSN=smtp://mailer:1025
# Production/Stage (uncomment and set SENDGRID_API_KEY in real env or secrets): # Production/Stage (uncomment and set SENDGRID_API_KEY in real env or secrets):
# MAILER_DSN=sendgrid+api://%env(SENDGRID_API_KEY)% # MAILER_DSN=sendgrid+api://%env(SENDGRID_API_KEY)%

View File

@@ -16,14 +16,14 @@ This repository contains a Symfony 7.3 (PHP >= 8.5.1) application for a collabor
6. Run tests: `vendor/bin/phpunit` 6. Run tests: `vendor/bin/phpunit`
- With Docker: - With Docker:
1. From `docker/`: `docker compose up -d` 1. `docker-compose up -d`
2. Install vendors inside the PHP container: 2. Install vendors inside the PHP container:
- `docker compose exec php bash` - `docker-compose exec php bash`
- `composer install` - `composer install`
3. Initialize DB: 3. Initialize DB:
- `php bin/console doctrine:database:create --if-not-exists` - `php bin/console doctrine:database:create --if-not-exists`
- `php bin/console doctrine:migrations:migrate -n` - `php bin/console doctrine:migrations:migrate -n`
4. App is at https://localhost:8443 (self-signed certificate) 4. App is at http://localhost:8080
## Email (Mailpit in dev, SendGrid for prod) ## Email (Mailpit in dev, SendGrid for prod)
- Dev: a `mailer` service (Mailpit) runs in Docker. - Dev: a `mailer` service (Mailpit) runs in Docker.
@@ -81,17 +81,17 @@ See doc/CONTRIBUTING.md for code style and more details.
We use a Mercure hub (Docker service) to push server updates to browsers via ServerSent Events (SSE). We use a Mercure hub (Docker service) to push server updates to browsers via ServerSent Events (SSE).
Quick start (dev): Quick start (dev):
1. Start Docker stack from `docker/`: 1. Start Docker stack:
``` ```
docker compose up -d docker-compose up -d
``` ```
This starts `mercure` at http://localhost:8090 and the app at https://localhost:8443. This starts `mercure` at http://localhost:8090 and the app at http://localhost:8080.
2. Install PHP deps inside the PHP container if you haven't yet: 2. Install PHP deps inside the PHP container if you haven't yet:
``` ```
docker compose exec php bash docker-compose exec php bash
composer install composer install
``` ```
3. Open the Game Hub page in your browser: https://localhost:8443/game 3. Open the Game Hub page in your browser: http://localhost:8080/game
- The page subscribes to a demo topic and logs messages in the console. - The page subscribes to a demo topic and logs messages in the console.
4. Publish a test update (in the PHP container): 4. Publish a test update (in the PHP container):
``` ```

View File

@@ -9,7 +9,7 @@ This app can run fully in Docker using docker compose with PHP-FPM, Nginx and My
- mailer (dev only via compose.override.yaml): Mailpit (SMTP/UI) - mailer (dev only via compose.override.yaml): Mailpit (SMTP/UI)
## Prerequisites ## Prerequisites
- Docker and Docker Compose (v2) - Docker and Docker Compose (docker-compose)
## Usage ## Usage
@@ -21,36 +21,36 @@ App will be served at http://localhost:8080
Alternatively (manual): Alternatively (manual):
``` ```
docker compose up -d --build docker-compose up -d --build
``` ```
### 2) Install dependencies ### 2) Install dependencies
The setup script already runs composer install. To run manually: The setup script already runs composer install. To run manually:
``` ```
docker compose exec php composer install docker-compose exec php composer install
``` ```
### 3) Prepare DB ### 3) Prepare DB
The setup script already prepares the DB. To run manually: The setup script already prepares the DB. To run manually:
``` ```
docker compose exec php php bin/console doctrine:database:create --if-not-exists docker-compose exec php php bin/console doctrine:database:create --if-not-exists
docker compose exec php php bin/console doctrine:migrations:migrate -n docker-compose exec php php bin/console doctrine:migrations:migrate -n
``` ```
### 4) Run tests ### 4) Run tests
``` ```
docker compose exec php vendor/bin/phpunit docker-compose exec php vendor/bin/phpunit
``` ```
### 5) Logs ### 5) Logs
``` ```
docker compose logs -f nginx docker-compose logs -f nginx
docker compose logs -f php docker-compose logs -f php
``` ```
### 6) Stop ### 6) Stop
``` ```
docker compose down docker-compose down
``` ```
## Notes ## Notes

View File

@@ -18,7 +18,7 @@ MAILER_DSN=smtp://mailer:1025
``` ```
- Usage: - Usage:
1. Start stack: `docker compose up -d` 1. Start stack: `docker-compose up -d`
2. Send an email from the app. 2. Send an email from the app.
3. Open http://localhost:8025 to view captured emails. 3. Open http://localhost:8025 to view captured emails.

View File

@@ -4,7 +4,7 @@ set -euo pipefail
# Script to completely restart the project as requested # Script to completely restart the project as requested
echo "Stopping and removing containers..." echo "Stopping and removing containers..."
dc() { (cd "$(dirname "$0")/.." && docker compose "$@"); } dc() { (cd "$(dirname "$0")/.." && docker-compose "$@"); }
dc down dc down
echo "Clearing Docker build cache..." echo "Clearing Docker build cache..."

View File

@@ -17,13 +17,13 @@ set -euo pipefail
ROOT_DIR=$(cd "$(dirname "$0")"/.. && pwd) ROOT_DIR=$(cd "$(dirname "$0")"/.. && pwd)
DOCKER_DIR="$ROOT_DIR/docker" DOCKER_DIR="$ROOT_DIR/docker"
# Determine the docker compose command (V2 'docker compose' or V1 'docker-compose') # Determine the docker-compose command
if docker compose version >/dev/null 2>&1; then if command -v docker-compose >/dev/null 2>&1; then
DOCKER_COMPOSE="docker compose"
elif command -v docker-compose >/dev/null 2>&1; then
DOCKER_COMPOSE="docker-compose" DOCKER_COMPOSE="docker-compose"
elif docker compose version >/dev/null 2>&1; then
DOCKER_COMPOSE="docker compose"
else else
echo "Error: Neither 'docker compose' nor 'docker-compose' was found. Please install Docker Compose." >&2 echo "Error: Neither 'docker-compose' nor 'docker compose' was found. Please install Docker Compose." >&2
exit 1 exit 1
fi fi