diff --git a/.gitignore b/.gitignore index ae56830a..301f1c16 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,7 @@ cookies.json keys.json # docker -docker-compose.yml +# docker-compose.yml # ide .vscode diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..b1d4b5db --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,34 @@ +services: + cobalt-api: + build: + context: . + dockerfile: Dockerfile + + working_dir: /app + + init: true + read_only: true + restart: unless-stopped + container_name: cobalt-api + + ports: + - 9000:9000/tcp + + environment: + API_URL: "http://localhost:9000/" + API_AUTH_REQUIRED: 1 + API_KEY_URL: "file:///keys.json" + + labels: + - com.centurylinklabs.watchtower.scope=cobalt + + volumes: + - ./keys.json:/keys.json:ro + + # watchtower updates the cobalt image automatically + watchtower: + image: ghcr.io/containrrr/watchtower + restart: unless-stopped + command: --cleanup --scope cobalt --interval 900 --include-restarting + volumes: + - /var/run/docker.sock:/var/run/docker.sock diff --git a/start.sh b/start.sh new file mode 100644 index 00000000..1bccf612 --- /dev/null +++ b/start.sh @@ -0,0 +1,3 @@ +#/bin/bash +docker compose down +docker compose up -d