Skip to content

Instantly share code, notes, and snippets.

@MilesChou
Last active March 20, 2019 03:36
Show Gist options
  • Save MilesChou/dfe95662c10769036a7b32145f92a219 to your computer and use it in GitHub Desktop.
Save MilesChou/dfe95662c10769036a7b32145f92a219 to your computer and use it in GitHub Desktop.
The basic Dockerfile for Laravel Framework
# Docker files
.dockerignore
Dockerfile
# Git files
.git
# Node files
node_modules
# Composer files
vendor
# Vagrant files
.vagrant
*.log
FROM php:7.1-apache
RUN set -xe && \
a2enmod rewrite && \
sed -i 's/DocumentRoot \/var\/www\/html/DocumentRoot \/var\/www\/html\/public/g' /etc/apache2/sites-enabled/000-default.conf
# Intalll no-dev vendor
COPY composer.json .
COPY composer.lock .
RUN composer install --no-dev --optimize-autoloader --quiet
# Copy all production code
COPY . .
RUN chmod 777 -R bootstrap/cache storage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment