Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct docker-compose.yml file? #10

Open
altynbek07 opened this issue Jun 20, 2020 · 2 comments
Open

Correct docker-compose.yml file? #10

altynbek07 opened this issue Jun 20, 2020 · 2 comments

Comments

@altynbek07
Copy link

Hi. I added an ipunktbs/laravel-queue-worker image to my docker-compose.yml file. Did I set it up correctly?

version: "3"
services:
  #PHP Service
  app:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: app
    restart: unless-stopped
    tty: true
    working_dir: /var/www
    volumes:
      - ./:/var/www
    networks:
      - app-network

  #Queue Service
  queue:
    image: ipunktbs/laravel-queue-worker
    container_name: queue
    restart: unless-stopped
    tty: true
    environment:
      QUEUE_CONNECTION: ${QUEUE_CONNECTION}
    volumes:
      - ./:/var/www/app
    networks:
    - app-network

  #Nginx Service
  webserver:
    image: nginx:alpine
    container_name: webserver
    restart: unless-stopped
    tty: true
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./:/var/www
      - ./docker/nginx/conf.d/:/etc/nginx/conf.d/
    networks:
    - app-network

  #MySQL Service
  db:
    image: mysql:5.7.22
    container_name: db
    restart: unless-stopped
    tty: true
    ports:
      - "3307:3306"
    environment:
      MYSQL_DATABASE: ${DB_DATABASE}
      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
    volumes:
      - dbdata_price-crawler:/var/lib/mysql
    networks:
      - app-network

#Docker Networks
networks:
  app-network:
    driver: bridge

#Volumes
volumes:
  dbdata_price-crawler:
    driver: local
@rokde
Copy link
Member

rokde commented Jun 21, 2020

I think so. Did it run?

@altynbek07
Copy link
Author

altynbek07 commented Jun 21, 2020

@rokde Yes, it works. What do you think about Task Scheduling? Add the cron task * * * * * cd /var/www/price-crawler && docker-compose exec app php artisan schedule:run >> /dev/null 2>&1 to the system itself, or create a separate container for it? I think this is the wrong way to start the task scheduler. Have you had experience with Task Scheduling and Docker? https://laravel.com/docs/7.x/scheduling#scheduling-queued-jobs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants