mirror of
https://github.com/elyby/accounts.git
synced 2024-11-06 08:11:24 +05:30
157 lines
3.3 KiB
YAML
157 lines
3.3 KiB
YAML
version: '3.4'
|
|
services:
|
|
web:
|
|
image: elyby/accounts/nginx:local
|
|
build:
|
|
context: .
|
|
target: web
|
|
args:
|
|
build_env: dev
|
|
depends_on:
|
|
- app
|
|
- emails-renderer
|
|
env_file: .env
|
|
ports:
|
|
- 80:80
|
|
volumes:
|
|
- ./:/var/www/html
|
|
|
|
app:
|
|
image: elyby/accounts:local
|
|
build:
|
|
context: .
|
|
target: app
|
|
args:
|
|
build_env: dev
|
|
depends_on:
|
|
- db
|
|
- redis
|
|
volumes:
|
|
- ./:/var/www/html
|
|
env_file: .env
|
|
networks:
|
|
default:
|
|
aliases:
|
|
- php
|
|
|
|
worker:
|
|
image: elyby/accounts:local
|
|
build:
|
|
context: .
|
|
target: app
|
|
args:
|
|
build_env: dev
|
|
command: ['php', 'yii', 'queue/listen', '-v']
|
|
depends_on:
|
|
- db
|
|
- redis
|
|
volumes:
|
|
- ./:/var/www/html
|
|
env_file: .env
|
|
|
|
cron:
|
|
image: elyby/accounts:local
|
|
build:
|
|
context: .
|
|
target: app
|
|
args:
|
|
build_env: dev
|
|
command: ['crond', '-s', '/etc/cron.d', '-f', '-L', '/var/log/cron.log']
|
|
stop_signal: SIGKILL
|
|
depends_on:
|
|
- db
|
|
- redis
|
|
volumes:
|
|
- ./:/var/www/html
|
|
env_file: .env
|
|
|
|
emails-renderer:
|
|
image: elyby/emails-renderer:dev
|
|
|
|
db:
|
|
image: elyby/accounts/mariadb:local
|
|
build:
|
|
context: .
|
|
target: db
|
|
args:
|
|
build_env: dev
|
|
volumes:
|
|
- ./data/mariadb:/bitnami/mariadb
|
|
environment:
|
|
ALLOW_EMPTY_PASSWORD: "yes"
|
|
MARIADB_ROOT_PASSWORD: ""
|
|
MARIADB_DATABASE: ely_accounts
|
|
MARIADB_USER: ely_accounts_user
|
|
MARIADB_PASSWORD: ely_accounts_password
|
|
|
|
redis:
|
|
image: redis:5.0-alpine
|
|
volumes:
|
|
- ./data/redis:/data
|
|
|
|
# If you want to use separate databases for the tests follow the next steps:
|
|
# 1) Create a file common/config/config-local.php with the next containment:
|
|
#
|
|
# <?php
|
|
# if (YII_ENV !== 'test') {
|
|
# return [];
|
|
# }
|
|
#
|
|
# return [
|
|
# 'components' => [
|
|
# 'db' => [
|
|
# 'dsn' => 'mysql:host=testdb;dbname=test',
|
|
# 'username' => 'test',
|
|
# 'password' => 'test',
|
|
# ],
|
|
# 'unbufferedDb' => [
|
|
# 'dsn' => 'mysql:host=testdb;dbname=test',
|
|
# 'username' => 'test',
|
|
# 'password' => 'test',
|
|
# ],
|
|
# 'redis' => [
|
|
# 'hostname' => 'testredis',
|
|
# 'password' => null,
|
|
# 'port' => 6379,
|
|
# 'database' => 0,
|
|
# ],
|
|
# ],
|
|
# ];
|
|
#
|
|
# 2) Uncomment the next 2 services (testdb and testredis):
|
|
#
|
|
# testdb:
|
|
# image: elyby/accounts/mariadb:local
|
|
# build:
|
|
# context: .
|
|
# target: db
|
|
# args:
|
|
# build_env: dev
|
|
# volumes:
|
|
# - ./data/mariadb-test:/bitnami/mariadb
|
|
# environment:
|
|
# ALLOW_EMPTY_PASSWORD: "yes"
|
|
# MARIADB_ROOT_PASSWORD: ""
|
|
# MARIADB_DATABASE: test
|
|
# MARIADB_USER: test
|
|
# MARIADB_PASSWORD: test
|
|
#
|
|
# testredis:
|
|
# image: redis:5.0-alpine
|
|
# volumes:
|
|
# - ./data/redis-test:/data
|
|
#
|
|
# 4) To run migrations on tests' database you must execute slightly adjusted
|
|
# migrate command: "env YII_ENV=test yii migrate"
|
|
|
|
phpmyadmin:
|
|
build: ./docker/phpmyadmin
|
|
environment:
|
|
- PMA_ARBITRARY=1
|
|
- PMA_USER=root
|
|
- PMA_PASSWORD=
|
|
depends_on:
|
|
- db
|
|
ports:
|
|
- 8080:80
|