Skip to content

Instantly share code, notes, and snippets.

@jjuanrivvera99
Last active March 19, 2021 23:09
Show Gist options
  • Select an option

  • Save jjuanrivvera99/c155f3b5f557542bd63da6efdd9b0d6b to your computer and use it in GitHub Desktop.

Select an option

Save jjuanrivvera99/c155f3b5f557542bd63da6efdd9b0d6b to your computer and use it in GitHub Desktop.

Revisions

  1. jjuanrivvera99 revised this gist Mar 19, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions docker-compose-laravel-mysql.yml
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@ services:
    image: nginx:alpine
    restart: always
    depends_on:
    - app
    - php
    ports:
    - "80:80"
    - "443:443"
    @@ -39,7 +39,7 @@ services:
    - laravel-network

    scheduler:
    command: sh -c 'while [ true ]; do php /var/www/artisan schedule:run --verbose --no-interaction & sleep 60; done
    command: sh -c 'while [ true ]; do php /var/www/artisan schedule:run --verbose --no-interaction & sleep 60; done'
    restart: always
    depends_on:
    - redis
  2. jjuanrivvera99 created this gist Mar 19, 2021.
    92 changes: 92 additions & 0 deletions docker-compose-laravel-mysql.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,92 @@
    version: '3.7'

    services:

    php:
    image: jjuanrivvera99/laravel:mysql-alpine
    restart: always
    depends_on:
    - redis
    volumes:
    - ./:/var/www
    - ./docker/php/local.ini:/usr/local/etc/php/conf.d/local.ini
    networks:
    - laravel-network

    web:
    image: nginx:alpine
    restart: always
    depends_on:
    - app
    ports:
    - "80:80"
    - "443:443"
    volumes:
    - ./:/var/www
    - ./docker/nginx/:/etc/nginx/conf.d/
    networks:
    - laravel-network

    queue:
    command: sh -c 'php artisan queue:work'
    restart: always
    depends_on:
    - redis
    image: jjuanrivvera99/laravel:mysql-alpine
    volumes:
    - "./:/var/www/"
    networks:
    - laravel-network

    scheduler:
    command: sh -c 'while [ true ]; do php /var/www/artisan schedule:run --verbose --no-interaction & sleep 60; done
    restart: always
    depends_on:
    - redis
    image: jjuanrivvera99/laravel:mysql-alpine
    volumes:
    - "./:/var/www/"
    networks:
    - laravel-network

    node:
    command: sh -c 'tail -f /dev/null'
    image: jjuanrivvera99/node:alpine
    restart: always
    container_name: node
    volumes:
    - ./:/var/www

    mysql:
    image: mysql:5.7
    restart: always
    ports:
    - "3306:3306"
    environment:
    MYSQL_DATABASE: laravel
    MYSQL_ROOT_PASSWORD: example
    volumes:
    - mysql-data:/var/lib/mysql/
    networks:
    - laravel-network

    redis:
    image: redis
    restart: always
    ports:
    - 6379:6379
    volumes:
    - redis-data:/data
    networks:
    - laravel-network

    networks:
    laravel-network:
    driver: bridge

    volumes:
    mysql-data:
    driver: local

    redis-data:
    driver: local