Advertisement
hfelix

Laravel DockerCompose

Jan 25th, 2022 (edited)
50
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None
  1. ### Create a docker-compose file , and paste this code inside.
  2.  
  3.  
  4. ## Create a directory with name "App" on root of docker-compose file.
  5.  
  6. ## Run docker-compose up -d to run theses containers.
  7.  
  8. ## Acess the container "app-php" : docker exec -it app-php bash .
  9.  
  10. ## Check if you are on "var/www" directory. If is , run composer install.
  11.  
  12. ### FOR PHP, COMPOSER, ETC
  13. app-php:
  14. image: 271217/felix-php-fpm-node
  15. container_name: app-php
  16. restart: unless-stopped
  17. working_dir: /var/www
  18. volumes:
  19. - ./App/:/var/www
  20.  
  21. ## for FPM
  22. php-fpm:
  23. image: 271217/felix-php-fpm
  24. container_name: php-fpm
  25. restart: unless-stopped
  26. working_dir: /var/www
  27. ports:
  28. - "9000"
  29. volumes:
  30. - ./App/:/var/www
  31. - ./docker-compose/php/php-fpm.conf:/etc/php7/php-fpm.conf
  32.  
  33. ## FOR NGINX
  34. nginx:
  35. image: nginx:1.17-alpine
  36. container_name: nginx
  37. restart: unless-stopped
  38. ports:
  39. - 80:80
  40. links:
  41. - cannoplus-fpm
  42. volumes:
  43. - ./App/:/var/www
  44. - ./docker-compose/nginx/vhost.conf:/etc/nginx/conf.d/default.conf
  45. - ./docker-compose/nginx/nginx.conf:/etc/nginx/nginx.conf
  46. - /var/run/docker.sock:/tmp/docker.sock:ro
  47.  
  48. ## FOR DATABASE
  49. app-db:
  50. image: mariadb
  51. container_name: app-db
  52. restart: unless-stopped
  53. volumes:
  54. - -db-data:/var/lib/mysql/
  55. ports:
  56. - 3306:3306
  57. environment:
  58. MYSQL_ROOT_PASSWORD: As32312##dasd!alsae
  59. MARIADB_USER: meuUser
  60. MARIADB_PASSWORD: As32##asd1311!alsae
Advertisement
RAW Paste Data Copied
Advertisement