Skip to content

Instantly share code, notes, and snippets.

@behroozam
Last active May 13, 2019 09:05
Show Gist options
  • Save behroozam/2983336e7e4fd5c29343d02739112762 to your computer and use it in GitHub Desktop.
Save behroozam/2983336e7e4fd5c29343d02739112762 to your computer and use it in GitHub Desktop.
laravel multi-stage Dockerfile
#
# Install PHP Dependencies
#
FROM composer:1.7 as vendor
COPY database/ database/
COPY composer.json composer.json
COPY composer.lock composer.lock
RUN composer install \
--ignore-platform-reqs \
--no-interaction \
--no-plugins \
--no-scripts \
--prefer-dist
#
# Frontend , if you using node uncomment
#
# FROM node:8.11 as frontend
#
# RUN mkdir -p /app/public
#
# COPY package.json webpack.mix.js yarn.lock /app/
# COPY resources/assets/ /app/resources/assets/
#
# WORKDIR /app
#
# RUN yarn install && yarn production
#
# Application Build
#
FROM behroozam/php-laravel:7.2
COPY . /server/http/public/
COPY --from=vendor /app/vendor/ /server/http/public/vendor/
#COPY --from=frontend /app/public/js/ /var/www/html/public/js/
#COPY --from=frontend /app/public/css/ /var/www/html/public/css/
#COPY --from=frontend /app/mix-manifest.json /var/www/html/mix-manifest.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment