summaryrefslogtreecommitdiffstats
path: root/.examples/docker-compose/insecure/mariadb-cron-redis/apache/docker-compose.yml
blob: 8b85c4ddacfe198cf7140e488bd30c1d14690462 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
version: '3'

services:
  db:
    image: mariadb
    # image: mysql
    restart: always
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=
    env_file:
      - db.env

  redis:
    image: redis
    restart: always

  app:  
    build: ./app
    restart: always
    ports:
      - 8080:80
    volumes:
      - nextcloud:/var/www/html
    env_file:
      - db.env
    depends_on:
      - db
      - redis

  cron:
    build: ./app
    restart: always
    volumes:
      - nextcloud:/var/www/html
    user: www-data
    entrypoint: |
      bash -c 'bash -s <<EOF
        trap "break;exit" SIGHUP SIGINT SIGTERM

        while [ ! -f /var/www/html/config/config.php ]; do
          sleep 1
        done

        while true; do
          php -f /var/www/html/cron.php
          sleep 15m
        done
      EOF'
    depends_on:
      - db
      - redis

volumes:
  db:
  nextcloud: