Test_commit of the entrypoint solution with dockerfile
This commit is contained in:
parent
34c9d4c1a1
commit
e253c54adb
13
Dockerfile
Normal file
13
Dockerfile
Normal file
@ -0,0 +1,13 @@
|
||||
# Use the existing Odoo image as the base
|
||||
FROM odoo:latest AS odoo-custom
|
||||
|
||||
# Copy the entrypoint script into the container
|
||||
COPY entrypoint_odoo.sh /usr/local/bin/entrypoint_odoo.sh
|
||||
|
||||
USER root
|
||||
|
||||
# Make the entrypoint script executable
|
||||
RUN chmod +x /usr/local/bin/entrypoint_odoo.sh
|
||||
|
||||
# Set the new entrypoint
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint_odoo.sh"]
|
47
__main__.py
47
__main__.py
@ -58,22 +58,37 @@ for container in containers_data.get("containers", []):
|
||||
|
||||
# Create the container
|
||||
try:
|
||||
container_resource = docker.Container(
|
||||
container_name,
|
||||
image=container["image"],
|
||||
envs=[
|
||||
f"{key}={value}" for key, value in container.get("envs", {}).items()
|
||||
] if "envs" in container else [],
|
||||
ports=[
|
||||
docker.ContainerPortArgs(
|
||||
internal=port["internal"],
|
||||
external=port["external"] + i
|
||||
) for port in container.get("ports", [])
|
||||
] if "ports" in container else [],
|
||||
volumes=volumes_config,
|
||||
network_mode=network.name if network else None,
|
||||
command=container.get("command", []),
|
||||
)
|
||||
if container["name"] == "odoo": # Special configuration for Odoo
|
||||
container_resource = docker.Container(
|
||||
container_name,
|
||||
image="odoo-custom", # Replace with pre-built image name
|
||||
envs=[f"{key}={value}" for key, value in container.get("envs", {}).items()],
|
||||
ports=[
|
||||
docker.ContainerPortArgs(
|
||||
internal=port["internal"],
|
||||
external=port["external"] + i
|
||||
) for port in container.get("ports", [])
|
||||
] if "ports" in container else [],
|
||||
volumes=volumes_config,
|
||||
network_mode=network.name if network else None,
|
||||
)
|
||||
else:
|
||||
container_resource = docker.Container(
|
||||
container_name,
|
||||
image=container["image"],
|
||||
envs=[
|
||||
f"{key}={value}" for key, value in container.get("envs", {}).items()
|
||||
] if "envs" in container else [],
|
||||
ports=[
|
||||
docker.ContainerPortArgs(
|
||||
internal=port["internal"],
|
||||
external=port["external"] + i
|
||||
) for port in container.get("ports", [])
|
||||
] if "ports" in container else [],
|
||||
volumes=volumes_config,
|
||||
network_mode=network.name if network else None,
|
||||
command=container.get("command", []),
|
||||
)
|
||||
ports = container.get("ports", [])
|
||||
if ports:
|
||||
for port in ports:
|
||||
|
@ -27,8 +27,7 @@
|
||||
"ODOO_PASSWORD": "admin"
|
||||
},
|
||||
"ports": [{"internal": 8069, "external": 8069}],
|
||||
"instances": 3,
|
||||
"command": ["/bin/bash", "-c", "sleep 10 && odoo -i base"]
|
||||
"instances": 3
|
||||
},
|
||||
{
|
||||
"name": "grafana",
|
||||
|
6
entrypoint_backup.sh
Normal file
6
entrypoint_backup.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -c
|
||||
|
||||
apk add --no-cache postgresql-client
|
||||
sleep 5
|
Loading…
Reference in New Issue
Block a user