version: "3.7" services: laravel: image: eslym/laravel-ca:build4 depends_on: - database - redis ports: - ${LARAVEL_PORT} deploy: mode: global resources: limits: memory: ${LARAVEL_MEM_LIMIT} restart: always logging: driver: "json-file" options: max-file: "5" max-size: 10m networks: - laravel-network volumes: - type: bind source: ./src target: /var/www/html - type: bind source: ./composer-cache target: /root/.composer/cache env_file: - ./php.env - ./fpm.env environment: - COMPOSER_INSTALL=no-dev - TZ=${TZ} redis: image: redis:alpine deploy: mode: global restart: always logging: driver: "json-file" options: max-file: "5" max-size: 10m networks: laravel-network: aliases: - redis volumes: - type: volume source: redis-data target: /data environment: - TZ=${TZ} database: image: mysql:5.7 ports: - ${MYSQL_PORT} deploy: mode: global restart: always logging: driver: "json-file" options: max-file: "5" max-size: 10m networks: laravel-network: aliases: - database volumes: - type: bind source: ./database target: /var/lib/mysql env_file: - ./database.env environment: - TZ=${TZ} volumes: redis-data: driver: local networks: laravel-network: driver: bridge