Dockerfile and webpack config updates

This commit is contained in:
Chris Kankiewicz
2020-01-12 20:09:09 -07:00
parent aeb87b19d8
commit 6331c1be0e
2 changed files with 11 additions and 13 deletions

View File

@@ -1,19 +1,19 @@
# Install PHP dependencies
FROM composer:1.9 AS php-dependencies
COPY . /app
RUN composer install --working-dir /app --ignore-platform-reqs \
COPY . /application
RUN composer install --working-dir /application --ignore-platform-reqs \
--no-cache --no-dev --no-interaction
# Install and compile JavaScript assets
FROM node:13.2 AS js-dependencies
COPY --from=php-dependencies /app /app
RUN cd /app && npm install && npm run production
COPY --from=php-dependencies /application /application
RUN cd /application && npm install && npm run production
# Build application image
FROM php:7.4-apache as application
LABEL maintainer="Chris Kankiewicz <Chris@ChrisKankiewicz.com>"
COPY --from=js-dependencies /app /var/www/html
COPY --from=js-dependencies /application /var/www/html
RUN a2enmod rewrite

View File

@@ -2,8 +2,6 @@ let mix = require('laravel-mix');
let tailwindcss = require('tailwindcss');
require('laravel-mix-purgecss');
mix.setPublicPath(path.resolve('.'));
mix.sass('app/resources/sass/app.scss', 'app/dist/app.css').options({
processCssUrls: false,
postCss: [tailwindcss('tailwind.config.js')]
@@ -17,12 +15,12 @@ mix.copyDirectory(
);
mix.purgeCss({
extensions: ["html", "js", "php", "scss", "twig", "vue"],
folders: ["app"],
whitelist: ["html", "body", "main", "fab", "fad", "fal", "far", "fas"],
extensions: ['html', 'js', 'php', 'scss', 'twig', 'vue'],
folders: ['app'],
whitelist: ['html', 'body', 'main', 'fab', 'fad', 'fal', 'far', 'fas'],
whitelistPatterns: [/^fa\-/]
});
if (mix.inProduction()) {
mix.version();
}
// if (mix.inProduction()) {
// mix.version();
// }