docker-compose.test.yml 2.88 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
version: '2'
services:

  # nginx
  #------------------------------------

  # proxies connections to app/chat

  web:
    container_name: foodsharing_test_web
11
    image: registry.gitlab.com/foodsharing-dev/images/web:1.1
12 13 14 15 16 17 18 19
    ports:
      - 28080:8080
    expose:
      - 8080
    depends_on:
      - app
      - chat
    volumes:
20
      - ../:/app
21 22 23 24 25 26

  # main php app
  #------------------------------------

  app:
    container_name: foodsharing_test_app
27
    image: registry.gitlab.com/foodsharing-dev/images/php:2.6
28
    working_dir: /app
29 30 31 32 33 34 35
    expose:
      - 9000
    links:
      - redis:redis
      - db:db
      - chat:chat
    volumes:
36
      - ../:/app
37
      - selenium_downloads:/downloads
38 39
    environment:
      FS_ENV: test
40
      REDIS_HOST: redis
41

42 43 44 45 46
  # php mail queue runner
  #------------------------------------

  mailqueuerunner:
    container_name: foodsharing_test_mailqueuerunner
47
    image: registry.gitlab.com/foodsharing-dev/images/php:2.6
Matthias Larisch's avatar
Matthias Larisch committed
48
    command: php run.php Mails queueWorker
49 50 51 52 53 54 55 56
    working_dir: /app
    links:
      - maildev
      - redis:redis
      - db:db
    volumes:
      - ../:/app
    environment:
57 58
      FS_ENV: test
      REDIS_HOST: redis
59

60 61
  chat:
    container_name: foodsharing_test_chat
62
    image: registry.gitlab.com/foodsharing-dev/images/chat:1.1
63
    command: sh -c "yarn && node server.js 0.0.0.0"
64
    working_dir: /app/chat
65 66
    depends_on:
      - redis
67 68
    environment:
      REDIS_HOST: redis
69 70 71 72
    expose:
      - 1337
      - 1338
    volumes:
73
      - ../:/app
74 75 76 77 78 79

  # mysql
  #------------------------------------

  db:
    container_name: foodsharing_test_db
80
    image: registry.gitlab.com/foodsharing-dev/images/db/test:1.0
81 82
    # so we can mount tmpfs inside container
    privileged: true
83 84 85 86 87 88 89
    expose:
      - 3306
    ports:
      - 23306:3306
    environment:
      MYSQL_ROOT_PASSWORD: root
    volumes:
90
      - ../:/app
91 92 93 94 95 96

  # redis
  #------------------------------------

  redis:
    container_name: foodsharing_test_redis
97
    image: redis:alpine
98 99 100
    expose:
      - 6379

101
  # selenium
102 103 104 105
  #------------------------------------

  # for running browser-based tests

106 107
  selenium:
    container_name: foodsharing_test_selenium
108
    image: registry.gitlab.com/foodsharing-dev/images/selenium:1.1
109
    shm_size: 256M
110 111 112 113
    links:
      - web:web
    expose:
      - 4444
114 115
    volumes:
      - selenium_downloads:/home/seluser/Downloads
116

117 118 119 120 121 122 123 124 125 126 127 128 129
  # phpmyadmin
  #------------------------------------

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: foodsharing_test_phpmyadmin
    environment:
      - PMA_ARBITRARY=1
    restart: always
    ports:
      - 28081:80
    volumes:
      - /sessions
130

131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
  # maildev
  #------------------------------------

  maildev:
    command: >
      bin/maildev
        --web 80
        --smtp 25
        --hide-extensions STARTTLS
    image: djfarrelly/maildev
    container_name: foodsharing_test_maildev
    ports:
      - 28083:80


146 147
volumes:
  selenium_downloads: