Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nicoolandgood/volta.sh-docker
Docker images for the volta.sh toolchain.
https://github.com/nicoolandgood/volta.sh-docker
docker dockerfile javascript toolchain volta
Last synced: 24 days ago
JSON representation
Docker images for the volta.sh toolchain.
- Host: GitHub
- URL: https://github.com/nicoolandgood/volta.sh-docker
- Owner: Nicoolandgood
- Created: 2024-06-06T07:37:06.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-11-14T11:18:08.000Z (2 months ago)
- Last Synced: 2024-11-14T12:24:43.937Z (2 months ago)
- Topics: docker, dockerfile, javascript, toolchain, volta
- Language: Dockerfile
- Homepage: https://hub.docker.com/r/nicoolandgood/volta.sh
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Volta.sh Docker
This repository contains Docker images for the [volta.sh](https://volta.sh/) toolchain.
## Usage
Either build the image or pull it from the repository:
```sh
# Building
docker build . --tag volta.sh:latest# Pulling
docker pull volta.sh:latest
```You can then run it with:
```sh
docker run -d volta.sh:latest
```## Build arguments
In order to customize your image, you can pass arguments to docker before the building process.
### `VOLTA_USER`
The user created inside the container. `volta` by default.```sh
docker build --build-arg="VOLTA_USER=jotaro" .
```## Env variables
### `NODE_VERSION`
The default `node` version installed when starting the image. `latest` by default.```sh
# This will run volta install node@16.
docker run -d -e "NODE_VERSION=16" nicoolangood/volta.sh
```### `PACKAGE_MANAGER`
The default package manager used inside the container.
Possible values are `npm`, `yarn` and `pnpm`, `npm` by default.```sh
# This will run volta install yarn.
docker run -d -e "PACKAGE_MANAGER=yarn" nicoolangood/volta.sh
```### `VOLTA_FEATURE_PNPM`
This enables the `pnpm` support. Its value is set to `1` by default.
You can find more information in [the volta pnpm support page](https://docs.volta.sh/advanced/pnpm).### `RUN_PACKAGE_MANAGER`
This runs the default package manager if set to `1`.
If not, `sleep infinity` is run.
Its value is set to `0` by default.Before running the package manager, it will install dependencies as such:
```sh
# If pnpm is the default package manager
pnpm i
pnpm $@
```Note that, by default, enabling this feature doesn't do much. It must be coupled with `CMD` override to
pass arguments to the package manager:```dockerfile
# ...image customizationCMD ["start"]
```will result to:
```sh
# If pnpm is the default package manager
pnpm i
pnpm start
```### `PACKAGE_MANAGER_INSTALL_ARGS`
This variable appends arguments during the dependencies installation.
It could be used to install only production dependencies:
```sh
docker build --build-arg="PACKAGE_MANAGER=yarn" .
docker run -d -e PACKAGE_MANAGER_INSTALL_ARGS='--production' volta.sh:latest
```will result to:
```sh
yarn install --production
yarn [some command]
```## Entrypoint script
The entrypoint script is located in `/entrypoint.sh`. It can be replaced to personalize container start behavior.
Here is an example with `docker compose`:
```yaml
services:
web-app:
image: volta.sh:latestvolume:
./my-entrypoint.sh:/entrypoint.sh
```