-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add configuration values for the Pipelines created containers #3428
Comments
+1, am running into the same issue. I am running Gitness behind Traefik and this is pretty annoying. |
I believe this is configurable using GITNESS_URL_CONTAINER Lines 99 to 104 in a989595
|
Hello, @bradrydzewski Here is a simple docker-compose.yml file with just version: '3.8'
services:
traefik:
container_name: traefik
image: traefik:latest
restart: always
networks:
- my_net
ports:
- '80:80/tcp'
volumes:
- ./config/traefik.yml:/etc/traefik/traefik.yml
- ./logs/:/logs/
- /var/run/docker.sock:/var/run/docker.sock:ro
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.traefik.rule=Host(`traefik.localhost`)'
- 'traefik.http.routers.traefik.service=api@internal'
- 'traefik.http.routers.traefik.entrypoints=web'
gitness:
container_name: gitness
image: harness/gitness:latest
restart: always
networks:
- my_net
ports:
- '3000:3000'
environment:
- GITNESS_DEBUG=true
- GITNESS_URL_BASE=http://gitness.localhost
- GITNESS_HTTP_PORT=3000
- GITNESS_URL_CONTAINER=http://gitness:3000
- GITNESS_PRINCIPAL_ADMIN_PASSWORD=password
- GITNESS_TOKEN_COOKIE_NAME=gitness_code_token
volumes:
- gitness_data:/data
- /var/run/docker.sock:/var/run/docker.sock
labels:
- 'traefik.enable=true'
- 'traefik.http.services.gitness.loadbalancer.server.port=3000'
- 'traefik.http.routers.gitness.rule=Host(`gitness.localhost`)'
- 'traefik.http.routers.gitness.entrypoints=web'
volumes:
gitness_data:
name: 'gitness_data'
networks:
my_net:
name: my_net
# API and dashboard configuration
api:
# Dashboard
dashboard: true
insecure: false
# Docker configuration backend
providers:
docker:
watch: true
exposedByDefault: false
swarmMode: false
# Traefik Logging & Access Logging
log:
level: ERROR
filePath: /logs/traefik.log
accesslog:
filePath: /logs/traefik_access.log
# Entrypoint
entryPoints:
web:
address: ':80' With this setup I can create project/repo/pipeline, clone, commit etc. All is working fine except running the pipeline failing at the clone step.
I tried severals values for
I tried to set the Lines 95 to 97 in a989595
Who can help? Thanks |
@ignaciolg @indaco @cozyGalvinism thanks for trying out Gitness and for your insight! I think that small bit should solve this issue where that env variable can be added to the gitness container docker-compose (say Let me know if the above makes sense - I do have a PR up for this and have done a basic sanity check using the above traefik config as reference but would be great to hear from you if you think there's a use case that's not being solved. Thanks! |
Hi folks, the above has been merged and will be available in the next release. We'll update the documentation with this use case. Let me know if you have any thoughts - thanks! |
First, thank you for helping with a solution. I've tried with the Is there any way to check if the CI runner is connected to the right network? Here is my docker-compose
|
To fix my issue #3485 i use GITNESS_URL_CONTAINER to change route to external domain. version: "3"
services:
gitness:
image: harness/gitness
restart: unless-stopped
volumes:
- ./data/gitness:/data
- /var/run/docker.sock:/var/run/docker.sock
environment:
- GITNESS_URL_BASE=https://gitness.${DOMAIN}
- GITNESS_URL_CONTAINER=https://gitness.${DOMAIN}
labels:
- "traefik.enable=true"
- "traefik.http.routers.gitness.rule=Host(`gitness.${DOMAIN}`)"
- "traefik.http.routers.gitness.entrypoints=websecure"
- "traefik.http.routers.gitness.service=gitness-svc"
- "traefik.http.services.gitness-svc.loadbalancer.server.port=3000" |
Gitness v3.0.0-beta.6 has been released. Docs have been updated with GITNESS_CI_CONTAINER_NETWORKS and GITNESS_URL_CONTAINER variables. |
Working on Gitness v3.0.0-beta.6 A note for podman-compose users I have created a new network called After using podlet to create quadlets (🤦 ) and enabling the service to get gitness up&&running on boot, the network name has changed to systemd-gitness Using those value on the GITNESS_CI_CONTAINER_NETWORKS worked without problems as you can see on the image. Keep this in mind Thank you all! Its great to have a self hosted CI environment integrated on the git platform. ❤️ |
thanks for trying @ignaciolg ! I'll go ahead and close the ticket, let me know if you face any other issues. |
I've tried to use my docker file template to deploy Gitness.
In that docker file, I define specific networks for the stack, and usually, I run everything without exposing ports by exposing the services with a tunnel (Cloudflare) or a proxy (Traefik)
Following this approach I have found that it is not possible to run pipelines, as they create the Drone container expecting to have access to Gitness using the 'http://host.docker.internal:3000/' address, instead of 'http://container_name:3000', accessible from the same docker network.
This results in an error on the first step of the pipeline that says 'unable to access 'http://host.docker.internal:3000/'
Changing the docker file by exposing the port makes it work.
It should be possible to specify the network for the newly created containers + where to find Gitness, as docker environment variables that can be passed on the container creation or as part of any docker file
The text was updated successfully, but these errors were encountered: