did something
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import docker
|
||||
from game_tables import GameTable
|
||||
|
||||
|
||||
def build_container_routing_labels(prefix, strip_prefix=True):
|
||||
def build_container_routing_labels(prefix: str, strip_prefix=True):
|
||||
router_key = "traefik.http.routers.{prefix}.rule".format(prefix=prefix)
|
||||
middleware_key = (
|
||||
"traefik.http.middlewares.{prefix}-stripprefix.stripprefix.prefixes".format(
|
||||
@@ -42,21 +43,21 @@ def stop_container(docker_id):
|
||||
container.kill()
|
||||
|
||||
|
||||
def start_foundry_container(table_name, prefix, version=12):
|
||||
def start_foundry_container(table: GameTable, version=12):
|
||||
client = docker.from_env()
|
||||
|
||||
image = "felddy/foundryvtt:{version}".format(version=version)
|
||||
labels = build_container_routing_labels(prefix, False)
|
||||
labels = build_container_routing_labels(table.game_table_link, False)
|
||||
volumes = {
|
||||
"/home/cow/Projects/dockertesting/server_data_mount/{prefix}".format(
|
||||
prefix=prefix
|
||||
prefix=table.game_table_link
|
||||
): {"bind": "/data", "mode": "rw"},
|
||||
"/home/cow/Projects/dockertesting/server_data_mount/foundry_cache": {
|
||||
"bind": "/data/container_cache"
|
||||
},
|
||||
}
|
||||
environment = [
|
||||
"FOUNDRY_ROUTE_PREFIX={prefix}".format(prefix=prefix)
|
||||
"FOUNDRY_ROUTE_PREFIX={prefix}".format(prefix=table.game_table_link)
|
||||
]
|
||||
|
||||
container = client.containers.run(
|
||||
|
||||
Reference in New Issue
Block a user