node-yarn is an alpine based Docker image with npm & yarn installed. Useful for separating front-end dependency installation from back-end dependency installation in a multi-step Docker file build.
Docker images can be pulled using the Docker CLI.
docker pull stephenneal/node-yarn:v2
Here's an example of a yarn dependency installation portion of a Laravel Application's Dockerfile. node dependencies are installed via the RUN yarn install
step and then the webpacks are built and compressed in the RUN yarn run ${yarn_env}
step.
# NodeJS package installer
FROM stephenneal/node-yarn:v2 AS node
# Yarn install environment ('production' or 'development')
ARG yarn_env="production"
# Copy npm package files
COPY ["package.json", "yarn.lock", "/var/www/"]
# Install node_modules
RUN yarn install
# Copy webpack files
COPY ["webpack.mix.js", "/var/www/"]
COPY webpacks /var/www/webpacks/
# Compile webpack assets
RUN yarn run ${yarn_env}
# Remove node_modules directory
RUN rm -r /var/www/node_modules
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.