mirror of
https://gitlab.sectorq.eu/home/docker-compose.git
synced 2025-12-14 10:24:53 +01:00
build
This commit is contained in:
@@ -2,11 +2,11 @@ version: '3.9'
|
|||||||
services:
|
services:
|
||||||
server:
|
server:
|
||||||
environment:
|
environment:
|
||||||
USER_UID: 1000
|
USER_UID: '1000'
|
||||||
USER_GID: 1000
|
USER_GID: '1000'
|
||||||
ROOT_URL: https://gitea.sectorq.eu
|
ROOT_URL: https://gitea.sectorq.eu
|
||||||
ENABLE_PASSWORD_SIGNIN_FORM: false
|
ENABLE_PASSWORD_SIGNIN_FORM: 'false'
|
||||||
DISABLE_REGISTRATION: true
|
DISABLE_REGISTRATION: 'true'
|
||||||
image: ${DOCKER_REGISTRY:-}gitea/gitea:latest
|
image: ${DOCKER_REGISTRY:-}gitea/gitea:latest
|
||||||
networks:
|
networks:
|
||||||
- gitea
|
- gitea
|
||||||
@@ -23,21 +23,21 @@ services:
|
|||||||
restart_policy:
|
restart_policy:
|
||||||
condition: any
|
condition: any
|
||||||
labels:
|
labels:
|
||||||
com.centurylinklabs.watchtower.enable: true
|
com.centurylinklabs.watchtower.enable: 'true'
|
||||||
homepage.container: gitea
|
homepage.container: gitea
|
||||||
homepage.description: Version control server
|
homepage.description: version control server
|
||||||
homepage.group: Utilities
|
homepage.group: utilities
|
||||||
homepage.href: https://${APPNAME}.sectorq.eu
|
homepage.href: https://${appname}.sectorq.eu
|
||||||
homepage.icon: ${APPNAME}.png
|
homepage.icon: ${appname}.png
|
||||||
homepage.name: Gitea
|
homepage.name: gitea
|
||||||
homepage.server: my-docker
|
homepage.server: my-docker
|
||||||
homepage.weight: 1
|
homepage.weight: '1'
|
||||||
homepage.widget.key: ${TOKEN}
|
homepage.widget.key: ${token}
|
||||||
homepage.widget.type: ${APPNAME}
|
homepage.widget.type: ${appname}
|
||||||
homepage.widget.url: https://${APPNAME}.sectorq.eu
|
homepage.widget.url: https://${appname}.sectorq.eu
|
||||||
homepage.widget.version: 2
|
homepage.widget.version: '2'
|
||||||
wud.watch: true
|
wud.watch: 'true'
|
||||||
wud.watch.digest: true
|
wud.watch.digest: 'true'
|
||||||
placement:
|
placement:
|
||||||
constraints:
|
constraints:
|
||||||
- node.role == manager
|
- node.role == manager
|
||||||
@@ -46,7 +46,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
CONFIG_FILE: /config/config.yaml
|
CONFIG_FILE: /config/config.yaml
|
||||||
GITEA_INSTANCE_URL: https://gitea.sectorq.eu/
|
GITEA_INSTANCE_URL: https://gitea.sectorq.eu/
|
||||||
GITEA_RUNNER_REGISTRATION_TOKEN: 8nmKqJhkvYwltmNfF2o9vs0tzo70ufHSQpVg6ymb
|
GITEA_RUNNER_REGISTRATION_TOKEN: 8nmkqjhkvywltmnff2o9vs0tzo70ufhsqpvg6ymb
|
||||||
GITEA_RUNNER_NAME: jaydee
|
GITEA_RUNNER_NAME: jaydee
|
||||||
GITEA_RUNNER_LABELS: jaydee
|
GITEA_RUNNER_LABELS: jaydee
|
||||||
volumes:
|
volumes:
|
||||||
@@ -59,8 +59,8 @@ services:
|
|||||||
restart_policy:
|
restart_policy:
|
||||||
condition: any
|
condition: any
|
||||||
labels:
|
labels:
|
||||||
wud.watch: true
|
wud.watch: 'true'
|
||||||
wud.watch.digest: true
|
wud.watch.digest: 'true'
|
||||||
placement:
|
placement:
|
||||||
constraints:
|
constraints:
|
||||||
- node.role == manager
|
- node.role == manager
|
||||||
|
|||||||
@@ -23,40 +23,51 @@ def convert_service(service):
|
|||||||
deploy_section = default_deploy()
|
deploy_section = default_deploy()
|
||||||
|
|
||||||
for key, value in service.items():
|
for key, value in service.items():
|
||||||
|
#print(key, value)
|
||||||
# Unsupported in Swarm
|
# Unsupported in Swarm
|
||||||
if key in ["container_name", "restart", "depends_on"]:
|
if key in ["container_name", "restart", "depends_on"]:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Move labels → deploy.labels
|
# Move labels → deploy.labels
|
||||||
|
#print(f"Labels: {deploy_section['labels']}")
|
||||||
if key == "labels":
|
if key == "labels":
|
||||||
|
input(f"Key: {key} Value: {value}")
|
||||||
|
#print("Processing Labels:")
|
||||||
if isinstance(value, dict):
|
if isinstance(value, dict):
|
||||||
deploy_section["labels"].update(value)
|
deploy_section["labels"].update({k: str(v).lower() for k, v in value.items()})
|
||||||
|
|
||||||
|
|
||||||
elif isinstance(value, list):
|
elif isinstance(value, list):
|
||||||
for item in value:
|
for item in value:
|
||||||
if "=" in item:
|
if "=" in item:
|
||||||
k, v = item.split("=", 1)
|
k, v = item.split("=", 1)
|
||||||
deploy_section["labels"][k] = v
|
deploy_section["labels"][k] = str(v).lower()
|
||||||
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
swarm_service[key] = value
|
swarm_service[key] = value
|
||||||
|
for en in swarm_service['environment']:
|
||||||
print(swarm_service['environment'])
|
#print(f"Environment Variable: {en} : {swarm_service['environment'][en]}")
|
||||||
|
swarm_service['environment'][en] = str(swarm_service['environment'][en]).lower()
|
||||||
|
#print("Deploy Section:")
|
||||||
|
#print(swarm_service)
|
||||||
# Merge user deploy section if present
|
# Merge user deploy section if present
|
||||||
|
#input(service)
|
||||||
if "deploy" in service:
|
if "deploy" in service:
|
||||||
user_deploy = service["deploy"]
|
user_deploy = service["deploy"]
|
||||||
|
#print("User Deploy Section:")
|
||||||
# merge deploy.labels
|
# merge deploy.labels
|
||||||
if "labels" in user_deploy:
|
if "labels" in user_deploy:
|
||||||
|
##print("User Deploy Labels:")
|
||||||
labels = user_deploy["labels"]
|
labels = user_deploy["labels"]
|
||||||
if isinstance(labels, dict):
|
if isinstance(labels, dict):
|
||||||
deploy_section["labels"].update(labels)
|
deploy_section["labels"].update(labels)
|
||||||
elif isinstance(labels, list):
|
elif isinstance(labels, list):
|
||||||
for item in labels:
|
for item in labels:
|
||||||
|
#print(f"Label Item: {item}")
|
||||||
if "=" in item:
|
if "=" in item:
|
||||||
k, v = item.split("=", 1)
|
k, v = item.split("=", 1)
|
||||||
deploy_section["labels"][k] = v
|
deploy_section["labels"][k] = str(v).lower()
|
||||||
|
|
||||||
# merge placement constraints
|
# merge placement constraints
|
||||||
if "placement" in user_deploy:
|
if "placement" in user_deploy:
|
||||||
|
|||||||
Reference in New Issue
Block a user