Created
May 24, 2019 12:04
-
-
Save arysom/e10cf4667414bd308ec53edb35470b18 to your computer and use it in GitHub Desktop.
laravel docker compose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '2' | |
| services: | |
| #PHP Service | |
| app: | |
| build: | |
| context: . | |
| dockerfile: Dockerfile | |
| image: digitalocean.com/php | |
| container_name: app | |
| restart: unless-stopped | |
| tty: true | |
| environment: | |
| SERVICE_NAME: app | |
| SERVICE_TAGS: dev | |
| working_dir: /var/www | |
| volumes: | |
| - ./:/var/www | |
| - ./php/local.ini:/usr/local/etc/php/conf.d/local.ini | |
| networks: | |
| - app-network | |
| #Nginx Service | |
| webserver: | |
| image: nginx:alpine | |
| container_name: webserver | |
| restart: unless-stopped | |
| tty: true | |
| ports: | |
| - "3535:80" | |
| - "443:443" | |
| volumes: | |
| - ./:/var/www | |
| - ./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: | |
| - "3306:3306" | |
| environment: | |
| MYSQL_DATABASE: laravel | |
| MYSQL_ROOT_PASSWORD: your_mysql_root_password | |
| SERVICE_TAGS: dev | |
| SERVICE_NAME: mysql | |
| networks: | |
| - app-network | |
| volumes: | |
| - dbdata:/var/lib/mysql | |
| - ./mysql/my.cnf:/etc/mysql/my.cnf | |
| networks: | |
| - app-network | |
| #Docker Networks | |
| networks: | |
| app-network: | |
| driver: bridge | |
| volumes: | |
| dbdata: | |
| driver: local |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment