Files
pollux/compose.yaml
T

66 lines
1.6 KiB
YAML

name: pollux
services:
app:
build: .
working_dir: /var/www
user: "${UID:-1000}:${GID:-1000}"
environment:
HOME: /tmp
COMPOSER_HOME: /tmp/composer
APP_URL: http://localhost:8000
DB_CONNECTION: mysql
DB_HOST: db
DB_PORT: "3306"
DB_DATABASE: pollux
DB_USERNAME: pollux
DB_PASSWORD: secret
volumes:
- .:/var/www
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
command: php artisan serve --host=0.0.0.0 --port=8000
db:
# TODO(compat): Upgrade MySQL 5.7 after validating a restored data copy,
# migrations and reports. Update db-test to the same target version.
image: mysql:5.7
environment:
MYSQL_DATABASE: pollux
MYSQL_USER: pollux
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: root
volumes:
- mysql-data:/var/lib/mysql
ports:
- "3307:3306"
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -uroot -proot --silent"]
interval: 5s
timeout: 5s
retries: 20
db-test:
# TODO(compat): Replace this legacy image alongside db during the MySQL
# upgrade; keep the test database isolated and run the full test suite.
image: mysql:5.7
profiles: [testing]
environment:
MYSQL_DATABASE: pollux_test
MYSQL_USER: pollux_test
MYSQL_PASSWORD: testing
MYSQL_ROOT_PASSWORD: testing-root
tmpfs:
- /var/lib/mysql
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -uroot -ptesting-root --silent"]
interval: 2s
timeout: 5s
retries: 30
volumes:
mysql-data: