docker-compose.yml 1.51 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
version: '3.7'
services:
  phpdeps:
    image: prooph/composer:7.3
    volumes:
      - .:/app
    command: install
  assets:
    image: node:10
    volumes:
      - .:/usr/src/app
    working_dir: /usr/src/app
    command: bash -c "npm install && npm run watch"
  dependencies:
15 16 17
    depends_on:
      - "mgdb"
    image: php:7.3-cli
18 19 20 21
    volumes:
      - .:/data
    working_dir: /data
    command: /data/init.sh
22
  mgdb:
Dominik Hebeler's avatar
Dominik Hebeler committed
23
    restart: on-failure
24 25 26 27 28 29 30
    image: mariadb:latest
    command: --default-authentication-plugin=mysql_native_password
    environment:
      - MYSQL_RANDOM_ROOT_PASSWORD=yes
      - MYSQL_USER=metager
      - MYSQL_PASSWORD=metager
      - MYSQL_DATABASE=metager
Dominik Hebeler's avatar
Dominik Hebeler committed
31 32 33 34
  redis:
    restart: on-failure
    image: redis:6.0-rc1-alpine
  phpfpm:
35
    depends_on:
36
      - "mgdb"
37 38 39
      - "dependencies"
      - "phpdeps"
      - "assets"
Dominik Hebeler's avatar
Dominik Hebeler committed
40
      - "redis"
Dominik Hebeler's avatar
Dominik Hebeler committed
41 42 43
    restart: on-failure
    build:
      context: .
Dominik Hebeler's avatar
Dominik Hebeler committed
44
      dockerfile: DockerfileDev
Dominik Hebeler's avatar
Dominik Hebeler committed
45 46 47 48 49 50 51 52 53
    image: metager:latest
    working_dir: /html
    volumes:
      - .:/html
  nginx:
    depends_on:
      - "phpfpm"
    restart: on-failure
    image: metager:latest
54
    working_dir: /html
Dominik Hebeler's avatar
Dominik Hebeler committed
55
    command: nginx
56 57
    volumes:
      - .:/html
Dominik Hebeler's avatar
Dominik Hebeler committed
58 59
      - ./config/nginx.conf:/etc/nginx/nginx.conf
      - ./config/nginx-default.conf:/etc/nginx/conf.d/default.conf
60 61
    ports: 
    - "8080:80"
Dominik Hebeler's avatar
Dominik Hebeler committed
62 63 64 65 66 67 68 69 70
  worker:
    depends_on:
      - "phpfpm"
    restart: on-failure
    image: metager:latest
    working_dir: /html
    volumes:
      - .:/html
    command: "su -s /bin/sh -c 'php artisan requests:fetcher' nginx"