commit 850d8b7680396a55c94f8f6933624dadeed95a19 Author: AlexMikhalev Date: Tue Dec 10 13:54:13 2024 +0000 First version diff --git a/README.md b/README.md new file mode 100644 index 0000000..e9119d3 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# Ultimate build machine using gitea + +Kind of kitchen sink everything is included + +## TODO + +- [ ] Automatic spin up and registration of gitea runners (github compatible) +- [ ] Earthly buildkit demon (not sattelite - with gitea runners we don't need earthly sattelites) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..77aad17 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,170 @@ +version: "3" +# FIXME: create default gitea bucket using rclone or aws cli +networks: + gitea: + external: false + +services: + server: + image: gitea/gitea:1.21.7 + container_name: gitea + environment: + - USER_UID=1000 + - USER_GID=1000 + - GITEA__database__DB_TYPE=postgres + - GITEA__database__HOST=db:5432 + - GITEA__database__NAME=gitea + - GITEA__database__USER=gitea + - GITEA__database__PASSWD=gitea + - GITEA__actions__ENABLE=true + - GITEA__repository__LFS_START_SERVER=true + - GITEA__repository__LFS_CONTENT_PATH=/data/lfs + - GITEA__storage__type=minio + - GITEA__storage__MINIO_ACCESS_KEY_ID=REDACTED_S3_ACCESS_KEY + - GITEA__storage__MINIO_SECRET_ACCESS_KEY=REDACTED_S3_SECRET_KEY + - GITEA__storage__MINIO_BUCKET=gitea + - GITEA__storage__MINIO_LOCATION=us-east-1 + - GITEA__storage__MINIO_ENDPOINT=http://s3:8333 + - GITEA__storage__MINIO_INSECURE_SKIP_VERIFY=false + - GITEA__storage__MINIO_USE_SSL=false + - GITEA__storage__SERVE_DIRECT=true + + restart: always + networks: + - gitea + volumes: + - ./gitea:/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + ports: + - "3000:3000" + - "222:22" + depends_on: + - db + - s3 + + db: + image: postgres:15 + restart: always + environment: + - POSTGRES_USER=gitea + - POSTGRES_PASSWORD=gitea + - POSTGRES_DB=gitea + networks: + - gitea + volumes: + - ./postgres:/var/lib/postgresql/data + master: + image: chrislusf/seaweedfs # use a remote image + ports: + - 9333:9333 + - 19333:19333 + - 9324:9324 + command: "master -ip=master -ip.bind=0.0.0.0 -metricsPort=9324" + # healthcheck: + # test: [ "CMD", "curl", "--fail", "-I", "http://master:9333/cluster/healthz" ] + # interval: 1s + # timeout: 120s + volume: + image: chrislusf/seaweedfs # use a remote image + ports: + - 8080:8080 + - 18080:18080 + - 9325:9325 + command: 'volume -mserver="master:9333" -ip.bind=0.0.0.0 -port=8080 -metricsPort=9325' + depends_on: + - master + # master: + # condition: service_healthy + volumes: + - ./seaweedfs:/data + filer: + image: chrislusf/seaweedfs # use a remote image + ports: + - 8888:8888 + - 18888:18888 + - 9326:9326 + command: 'filer -master="master:9333" -ip.bind=0.0.0.0 -metricsPort=9326' + tty: true + stdin_open: true + depends_on: + - master + - volume + # volume: + # condition: service_healthy + volumes: + - ./seaweedfs_filter:/data + # healthcheck: + # test: [ "CMD", "curl", "--fail", "-I", "http://volume:8888" ] + # interval: 1s + # timeout: 30s + s3: + image: chrislusf/seaweedfs + container_name: s3storage + hostname: s3storage # use a remote image + ports: + - 8333:8333 + - 9327:9327 + command: 's3 -config=/etc/seaweedfs/s3.json -filer="filer:8888" -ip.bind=0.0.0.0 -metricsPort=9327' + depends_on: + - master + - volume + - filer + volumes: + - ./s3_config.json:/etc/seaweedfs/s3.json + nginx-gateway-s3: + image: ghcr.io/nginxinc/nginx-s3-gateway/nginx-oss-s3-gateway:latest + container_name: nginx-s3-gateway + ports: + - 9080:80 + restart: on-failure + environment: + S3_BUCKET_NAME: gitea + AWS_ACCESS_KEY_ID: "REDACTED_S3_ACCESS_KEY" + AWS_SECRET_ACCESS_KEY: "REDACTED_S3_SECRET_KEY" + AWS_SIGS_VERSION: 4 + S3_SERVER: s3 + S3_SERVER_PORT: 8333 + S3_SERVER_PROTO: http + S3_REGION: us-east-1 + S3_STYLE: path + DEBUG: false + ALLOW_DIRECTORY_LIST: false + PROVIDE_INDEX_PAGE: true + APPEND_SLASH_FOR_POSSIBLE_DIRECTORY: true + DIRECTORY_LISTING_PATH_PREFIX: "" + PROXY_CACHE_MAX_SIZE: 10g + PROXY_CACHE_SLICE_SIZE: 1m + PROXY_CACHE_INACTIVE: 60m + PROXY_CACHE_VALID_OK: 1h + PROXY_CACHE_VALID_NOTFOUND: 1m + PROXY_CACHE_VALID_FORBIDDEN: 30s + # STRIP_LEADING_DIRECTORY_PATH: /somepath + depends_on: + - s3 + prometheus: + image: prom/prometheus:v2.21.0 + ports: + - 9000:9090 + volumes: + - ./prometheus:/etc/prometheus + command: --web.enable-lifecycle --config.file=/etc/prometheus/prometheus.yml + depends_on: + - s3 + # panamax: + # image: panamaxrs/panamax + # container_name: crates + # volumes: + # - ./crates_data/:/mirror + # # entrypoint: ["/usr/local/bin/panamax"] + # # command: "/usr/local/bin/panamax init /mirror && + # # /usr/local/bin/panamax sync /mirror && + # # /usr/local/bin/panamax serve /mirror" + # command: + # - sync /mirror + # # - serve + # ports: + # - 18080:8080 + # environment: + # - USER_UID=1000 + # - USER_GID=1000 \ No newline at end of file diff --git a/s3_config.json b/s3_config.json new file mode 100644 index 0000000..f162fbb --- /dev/null +++ b/s3_config.json @@ -0,0 +1,27 @@ +{ + "identities": [ + { + "name": "anonymous", + "actions": [ + "Read" + ] + }, + { + "name": "gitea", + "credentials": [ + { + "accessKey": "REDACTED_S3_ACCESS_KEY", + "secretKey": "REDACTED_S3_SECRET_KEY" + } + ], + "actions": [ + "Admin", + "Read", + "List", + "Tagging", + "Write" + ] + } + ] + } + \ No newline at end of file