Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sfneal/node-yarn
Docker images with Yarn CLI installations for installing front-end dependencies in isolated containers.
https://github.com/sfneal/node-yarn
docker nodejs yarn
Last synced: 6 days ago
JSON representation
Docker images with Yarn CLI installations for installing front-end dependencies in isolated containers.
- Host: GitHub
- URL: https://github.com/sfneal/node-yarn
- Owner: sfneal
- License: mit
- Created: 2019-08-07T15:25:40.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-27T08:05:25.000Z (20 days ago)
- Last Synced: 2024-10-27T09:22:34.032Z (19 days ago)
- Topics: docker, nodejs, yarn
- Language: Shell
- Homepage:
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# sfneal/node-yarn
[![Build Status](https://travis-ci.com/sfneal/node-yarn.svg?branch=master&style=flat-square)](https://travis-ci.com/sfneal/node-yarn)
[![Total Downloads](https://img.shields.io/docker/pulls/stephenneal/node-yarn?style=flat-square)](https://hub.docker.com/r/stephenneal/node-yarn)
[![Latest Version](https://img.shields.io/docker/v/stephenneal/node-yarn?sort=semver&style=flat-square)](https://hub.docker.com/r/stephenneal/node-yarn)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.
## Installation
Docker images can be pulled using the Docker CLI.
```bash
docker pull stephenneal/node-yarn:v2
```## Usage
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.
```dockerfile
# 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
```## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
### Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
## Credits
- [Stephen Neal](https://github.com/sfneal)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.