formatting, mostly

This commit is contained in:
vmorganp
2024-02-06 02:22:48 -07:00
parent 20e5713dd0
commit bc88753264
10 changed files with 85 additions and 67 deletions

View File

@@ -9,7 +9,7 @@ on:
push:
branches: [master]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
tags: ["v*.*.*"]
pull_request:
branches: [master]
@@ -19,7 +19,6 @@ env:
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest

View File

@@ -1,16 +1,18 @@
# Lazytainer - Lazy Load Containers
Putting your containers to sleep
[![Docker](https://github.com/vmorganp/Lazytainer/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/vmorganp/Lazytainer/actions/workflows/docker-publish.yml)
---
---
https://github.com/vmorganp/Lazytainer/assets/31448722/91af5528-6fee-4837-b4d8-11c03e792e94
## Quick Explanation
Monitors network traffic to containers. If there is traffic, the container runs, otherwise the container is stopped/paused. for more details check out the [Configuration](##Configuration) section.
## Want to test it?
1. Clone the project
```
git clone https://github.com/vmorganp/Lazytainer
@@ -18,26 +20,31 @@ Monitors network traffic to containers. If there is traffic, the container runs,
```
2. Start the stack
```sh
docker-compose up
if "docker compose" doesn't work, try "docker-compose"
docker compose up
```
This will create 2 containers that you can reach through a third "lazytainer" container
3. View the running container by navigating to its web ui at `http://localhost:81`. You should see some information about the container
4. Close the tab and wait until the logs say "stopped container"
6. Navigate again to `http://localhost:81`, it should be a dead page
7. Navigate to `http://localhost:81` several times, enough to generate some network traffic, and it should start
8. To clean up, run
5. Navigate again to `http://localhost:81`, it should be a dead page
6. Navigate to `http://localhost:81` several times, enough to generate some network traffic, and it should start
7. To clean up, run
```sh
docker-compose down
```
## Configuration
### Note:
Lazytainer does not "automatically" start and stop all of your containers. You must apply a label to them and proxy their traffic through the Lazytainer container.
### Examples
For examples of lazytainer in action, check out the [Examples](./examples/)
### Groups
Lazytainer starts and stops other containers in "groups" of one or more other containers. To assign a container to a lazytainer group, a label must be added. The label will look like this.
```yaml
@@ -48,6 +55,7 @@ yourContainerThatWillSleep:
```
To configure a group, add labels to the lazytainer container like this. Note that each is required to have a port(s) specified. These ports must also be forwarded on the lazytainer container
```yaml
lazytainer:
# ... configuration omitted for brevity
@@ -75,8 +83,11 @@ Group properties that can be changed include:
| netInterface | Network interface to listen on | No | `eth0` |
### Additional Configuration
#### Verbose Logging
If you would like more verbose logging, you can apply the environment variable `VERBOSE=true` to lazytainer like so
```yaml
lazytainer:
# ... configuration omitted for brevity
@@ -85,7 +96,9 @@ If you would like more verbose logging, you can apply the environment variable `
```
#### Volumes
If using lazytainer, you MUST provide the following volume to lazytainer
```yaml
lazytainer:
# ... configuration omitted for brevity

View File

@@ -1,5 +1,7 @@
# Lazy Load Docker Minecraft Server
## Startup
```
git clone https://github.com/vmorganp/Lazytainer
cd Lazytainer/examples/minecraft
@@ -7,6 +9,7 @@ docker-compose up
```
## Watch the magic happen
After a configurable period of no activity the server should stop
if you generate some traffic by trying to connect to the instance or running a command like

View File

@@ -1,5 +1,7 @@
# Lazy Load Docker Satisfactory Server
## Startup
```
git clone https://github.com/vmorganp/Lazytainer
cd Lazytainer/examples/satisfactory
@@ -9,9 +11,11 @@ docker compose up
or
#### Deploy with Portainer, etc
Copy contents of docker-compose.yml into a stack, it should automatically deploy
## Notes
- "lazytainer.group.satisfactory.inactiveTimeout=120"
This may need to be adjusted based on your physical hardware. If you have slower hardware, the server client may not start with enough time to accept clients and create additional traffic.

View File

@@ -2,8 +2,8 @@ version: "3"
services:
satisfactory-server:
container_name: 'satisfactory'
image: 'wolveix/satisfactory-server:latest'
container_name: "satisfactory"
image: "wolveix/satisfactory-server:latest"
volumes:
- /your/game_files/satisfactory:/config # Path must be changed to your satisfactory save mount
environment:
@@ -30,9 +30,9 @@ services:
environment:
- VERBOSE=true
ports:
- '15777:15777/udp' # This is the query port, supplies packets when the server browser is used.
- '7777:7777/udp' # This port handles the actual game traffic
- '15000:15000/udp' # This port handles outbound check-ins "beacon", etc.
- "15777:15777/udp" # This is the query port, supplies packets when the server browser is used.
- "7777:7777/udp" # This port handles the actual game traffic
- "15000:15000/udp" # This port handles outbound check-ins "beacon", etc.
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
labels:

View File

@@ -26,7 +26,7 @@ services:
devices:
- /dev/net/tun
volumes:
- './zt:/var/lib/zerotier-one'
- "./zt:/var/lib/zerotier-one"
cap_add:
- NET_ADMIN
- SYS_ADMIN
@@ -40,4 +40,3 @@ services:
- lazytainer
labels:
- "lazytainer.group=group1"