Skip to content

Instantly share code, notes, and snippets.

@kevinzie
Last active June 24, 2022 20:25
Show Gist options
  • Save kevinzie/609743578edf940cbcbbd2f77a1d530b to your computer and use it in GitHub Desktop.
Save kevinzie/609743578edf940cbcbbd2f77a1d530b to your computer and use it in GitHub Desktop.
Docker Compose Laravel Apache / Nginx
version: "3.7"
services:
app:
build:
args:
user: kevinzie
uid: 1000
context: './'
dockerfile: Dockerfile
container_name: laravel-app
ports:
- 8089:80
environment:
- APACHE_RUN_USER=#1000
- APACHE_RUN_GROUP=#1000
volumes:
- ./:/var/www/public
- ./docker-compose/apache/vhost.conf:/etc/apache2/sites-enabled/000-default.conf
networks:
- laravel
# restart: unless-stopped
# app:
# build:
# args:
# user: sammy
# uid: 1000
# context: ./
# dockerfile: Dockerfile
# image: 'app/laravel'
# container_name: laravel-app
# restart: unless-stopped
# working_dir: /var/www/html
# ports:
# - "8080:80"
# volumes:
# - ./:/var/www/html
# networks:
# - laravel
# db:
# image: mysql:5.7
# container_name: laravel-db
# restart: unless-stopped
# environment:
# MYSQL_DATABASE: ${DB_DATABASE}
# MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
# MYSQL_PASSWORD: ${DB_PASSWORD}
# MYSQL_USER: ${DB_USERNAME}
# SERVICE_TAGS: dev
# SERVICE_NAME: mysql
# volumes:
# - ./docker-compose/mysql:/docker-entrypoint-initdb.d
# networks:
# - laravel
# nginx:
# image: nginx:1.17-alpine
# container_name: laravel-nginx
# restart: unless-stopped
# ports:
# - 8000:80
# volumes:
# - ./:/var/www
# - ./docker-compose/nginx:/etc/nginx/conf.d
# networks:
# - laravel
networks:
laravel:
driver: bridge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment