https://github.com/ralphv/simple-node-express
A simple node express
https://github.com/ralphv/simple-node-express
Last synced: 30 days ago
JSON representation
A simple node express
- Host: GitHub
- URL: https://github.com/ralphv/simple-node-express
- Owner: ralphv
- Created: 2023-08-28T15:49:44.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-30T17:48:23.000Z (almost 3 years ago)
- Last Synced: 2025-10-10T17:08:13.737Z (10 months ago)
- Language: JavaScript
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Purpose
Use this simple image in your quick projects to create containers that respond to any path/url/method with some simple output.
You can find this at [https://hub.docker.com/r/ralphv/simple-node-express](https://hub.docker.com/r/ralphv/simple-node-express)
To pull built image:
```shell
docker pull ralphv/simple-node-express
```
### To build locally
```shell
docker build --no-cache . -t ralphv/simple-node-express:latest`
```
### Environment variables:
* `SERVICE_NAME`: Just a service name, an identity to give to the particular instance of this container, defaults to `N/A`
* `PORT`: The port to listen to, defaults to `8080`
### To run
```shell
docker run -it --init --rm \
-p 8080:8080 \
-e PORT='8080' \
-e SERVICE_NAME='from-docker-run' \
--name simple-node-express \
ralphv/simple-node-express:latest
```
### To build with buildx for multiple platforms using Windows/Raspberry pi 4
* Make sure raspberry pi doesn't need sudo [https://github.com/sindresorhus/guides/blob/main/docker-without-sudo.md](https://github.com/sindresorhus/guides/blob/main/docker-without-sudo.md)
* Setup root access through ssh if the above doesn't work, either way the next command should work
* This command should work `docker -H ssh://USER@HOST ps`
* Run this command `docker buildx create --name localremote_builder --node localremote_builder0 --platform linux/arm64/v8,linux/amd64,linux/s390x --driver-opt env.BUILDKIT_STEP_LOG_MAX_SIZE=10000000 --driver-opt env.BUILDKIT_STEP_LOG_MAX_SPEED=10000000`
* Run this command `docker buildx create --name localremote_builder --append --node pi --platform linux/arm/v7,linux/arm/v8 ssh://USER@HOST --driver-opt env.BUILDKIT_STEP_LOG_MAX_SIZE=10000000 --driver-opt env.BUILDKIT_STEP_LOG_MAX_SPEED=10000000`
* Confirm with `docker buildx ls`
* Use the context `docker buildx use localremote_builder`
To build
```shell
docker buildx build --push --platform linux/arm64/v8,linux/amd64,linux/s390x,linux/arm/v7,linux/arm/v8 --tag ralphv/simple-node-express:latest .
```
To fix raspberry pi 4 problems building
https://blog.samcater.com/fix-workaround-rpi4-docker-libseccomp2-docker-20/