diff --git a/src/clash/docker-compose.yaml b/src/clash/docker-compose.yaml new file mode 100644 index 0000000..dffa0b7 --- /dev/null +++ b/src/clash/docker-compose.yaml @@ -0,0 +1,21 @@ +x-default: &default + restart: unless-stopped + volumes: + - &localtime /etc/localtime:/etc/localtime:ro + - &timezone /etc/timezone:/etc/timezone:ro + logging: + driver: json-file + options: + max-size: 100m + +services: + clash: + <<: *default + image: centralx/clash:${CLASH_VERSION:-1.18.0} + ports: + - "7880:80" + - "7890:7890" + volumes: + - *localtime + - *timezone + - ./config.yaml:/home/runner/.config/clash/config.yaml diff --git a/src/gitea/docker-compose.yml b/src/gitea/docker-compose.yaml similarity index 100% rename from src/gitea/docker-compose.yml rename to src/gitea/docker-compose.yaml diff --git a/src/gitlab-runner/docker-compose.yml b/src/gitlab-runner/docker-compose.yaml similarity index 100% rename from src/gitlab-runner/docker-compose.yml rename to src/gitlab-runner/docker-compose.yaml diff --git a/src/io-paint/.gitignore b/src/io-paint/.gitignore new file mode 100644 index 0000000..f633594 --- /dev/null +++ b/src/io-paint/.gitignore @@ -0,0 +1 @@ +/models diff --git a/src/io-paint/Dockerfile b/src/io-paint/Dockerfile new file mode 100644 index 0000000..1c2f40e --- /dev/null +++ b/src/io-paint/Dockerfile @@ -0,0 +1,18 @@ +FROM pytorch/pytorch:2.6.0-cuda12.4-cudnn9-runtime +ARG DEBIAN_FRONTEND=noninteractive +ARG VERSION=1.6.0 + +WORKDIR /workspace + +RUN apt-get update && apt-get install -y --no-install-recommends \ + software-properties-common \ + libsm6 libxext6 ffmpeg libfontconfig1 libxrender1 libgl1-mesa-glx \ + curl python3-pip +RUN apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +RUN python3 -m pip install --upgrade pip +RUN pip3 install iopaint==${VERSION} && pip3 cache purge + +EXPOSE 8080 +CMD ["iopaint", "start", "--model=lama", "--device=cuda", "--port=8080", "--host=0.0.0.0"] diff --git a/src/io-paint/README.md b/src/io-paint/README.md new file mode 100644 index 0000000..73d590b --- /dev/null +++ b/src/io-paint/README.md @@ -0,0 +1,3 @@ +# IOPaint + +Ref: [Dockerfile](https://github.com/Sanster/IOPaint/blob/main/docker/GPUDockerfile) diff --git a/src/io-paint/docker-compose.yaml b/src/io-paint/docker-compose.yaml new file mode 100644 index 0000000..4eca9c9 --- /dev/null +++ b/src/io-paint/docker-compose.yaml @@ -0,0 +1,39 @@ +x-default: &default + restart: unless-stopped + volumes: + - &localtime /etc/localtime:/etc/localtime:ro + - &timezone /etc/timezone:/etc/timezone:ro + logging: + driver: json-file + options: + max-size: 100m + +services: + lama-cleaner: + <<: *default + image: ${DOCKER_REGISTRY:-docker.io}/local/lama-cleaner:${BUILD_VERSION:-latest} + ports: + - 8080:8080 + build: + context: . + dockerfile: Dockerfile + # environment: + # HF_ENDPOINT: https://hf-mirror.com + volumes: + - *localtime + - *timezone + - ./models:/root/.cache + command: + - iopaint + - start + - --model=lama + - --device=cuda + - --port=8080 + - --host=0.0.0.0 + deploy: + resources: + reservations: + devices: + - driver: nvidia + device_ids: ['0'] + capabilities: [compute, utility] diff --git a/src/mongodb-standalone/.env.example b/src/mongodb-standalone/.env.example new file mode 100644 index 0000000..9f9838a --- /dev/null +++ b/src/mongodb-standalone/.env.example @@ -0,0 +1,12 @@ +# MongoDB Version +MONGO_VERSION=8.0.13 + +# MongoDB root credentials +MONGO_INITDB_ROOT_USERNAME=root +MONGO_INITDB_ROOT_PASSWORD=password + +# Initial database name +MONGO_INITDB_DATABASE=admin + +# MongoDB ports configuration +MONGO_PORT_OVERRIDE=27017 diff --git a/src/mongodb-standalone/docker-compose.yaml b/src/mongodb-standalone/docker-compose.yaml new file mode 100644 index 0000000..f3ac128 --- /dev/null +++ b/src/mongodb-standalone/docker-compose.yaml @@ -0,0 +1,32 @@ +x-default: &default + restart: unless-stopped + volumes: + - &localtime /etc/localtime:/etc/localtime:ro + - &timezone /etc/timezone:/etc/timezone:ro + logging: + driver: json-file + options: + max-size: 100m + +services: + mongo: + <<: *default + image: mongo:${MONGO_VERSION:-8.0.13} + environment: + MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME:-root} + MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD:-password} + MONGO_INITDB_DATABASE: ${MONGO_INITDB_DATABASE:-admin} + ports: + - "${MONGO_PORT_OVERRIDE:-27017}:27017" + volumes: + - *localtime + - *timezone + - mongo_data:/data/db + deploy: + resources: + limits: + cpus: '0.50' + memory: 1G + reservations: + cpus: '0.25' + memory: 256M diff --git a/src/open-webui/README.md b/src/open-webui/README.md index ba95a76..0825e80 100644 --- a/src/open-webui/README.md +++ b/src/open-webui/README.md @@ -13,8 +13,8 @@ This service deploys Open WebUI, a web-based interface for LLMs. ## Configuration - `OPEN_WEBUI_VERSION`: The version of the Open WebUI image, default is `main`. -- `OPEN_WEBUI_PORT`: The host port for Open WebUI, default is `8080`. +- `OPEN_WEBUI_PORT_OVERRIDE`: The host port for Open WebUI, default is `8080`. ## Volumes -- `open-webui`: A volume for storing Open WebUI data. +- `open_webui_data`: A volume for storing Open WebUI data. diff --git a/src/open-webui/README.zh.md b/src/open-webui/README.zh.md index f5d843a..2c5b553 100644 --- a/src/open-webui/README.zh.md +++ b/src/open-webui/README.zh.md @@ -13,8 +13,8 @@ ## 配置 - `OPEN_WEBUI_VERSION`: Open WebUI 镜像的版本,默认为 `main`。 -- `OPEN_WEBUI_PORT`: Open WebUI 的主机端口,默认为 `8080`。 +- `OPEN_WEBUI_PORT_OVERRIDE`: Open WebUI 的主机端口,默认为 `8080`。 ## 卷 -- `open-webui`: 用于存储 Open WebUI 数据的卷。 +- `open_webui_data`: 用于存储 Open WebUI 数据的卷。 diff --git a/src/open-webui/docker-compose.yml b/src/open-webui/docker-compose.yaml similarity index 82% rename from src/open-webui/docker-compose.yml rename to src/open-webui/docker-compose.yaml index b31f246..b1b449f 100644 --- a/src/open-webui/docker-compose.yml +++ b/src/open-webui/docker-compose.yaml @@ -9,15 +9,15 @@ x-default: &default max-size: 100m services: - openwebui: + open_webui: <<: *default image: ghcr.io/open-webui/open-webui:${OPEN_WEBUI_VERSION:-main} ports: - - "${OPEN_WEBUI_PORT:-8080}:8080" + - "${OPEN_WEBUI_PORT_OVERRIDE:-8080}:8080" volumes: - *localtime - *timezone - - open-webui:/app/backend/data + - open_webui_data:/app/backend/data env_file: - .env deploy: @@ -30,4 +30,4 @@ services: memory: 128M volumes: - open-webui: + open_webui_data: diff --git a/src/opencut/README.md b/src/opencut/README.md new file mode 100644 index 0000000..1221f69 --- /dev/null +++ b/src/opencut/README.md @@ -0,0 +1,3 @@ +# OpenCut + + diff --git a/src/opencut/docker-compose.yaml b/src/opencut/docker-compose.yaml new file mode 100644 index 0000000..e4f9672 --- /dev/null +++ b/src/opencut/docker-compose.yaml @@ -0,0 +1,91 @@ +services: + db: + image: postgres:17 + restart: unless-stopped + environment: + POSTGRES_USER: opencut + POSTGRES_PASSWORD: opencutthegoat + POSTGRES_DB: opencut + volumes: + - postgres_data:/var/lib/postgresql/data + ports: + - "5432:5432" + healthcheck: + test: ["CMD-SHELL", "pg_isready -U opencut"] + interval: 30s + timeout: 10s + retries: 5 + start_period: 10s + + redis: + image: redis:7-alpine + restart: unless-stopped + ports: + - "6379:6379" + healthcheck: + test: ["CMD", "redis-cli", "ping"] + interval: 30s + timeout: 10s + retries: 5 + start_period: 10s + + serverless-redis-http: + image: hiett/serverless-redis-http:latest + ports: + - "8079:80" + environment: + SRH_MODE: env + SRH_TOKEN: example_token + SRH_CONNECTION_STRING: "redis://redis:6379" + depends_on: + redis: + condition: service_healthy + healthcheck: + test: ["CMD-SHELL", "wget --spider -q http://127.0.0.1:80 || exit 1"] + interval: 30s + timeout: 10s + retries: 5 + start_period: 10s + web: + build: + context: . + dockerfile: ./apps/web/Dockerfile + args: + - FREESOUND_CLIENT_ID=${FREESOUND_CLIENT_ID} + - FREESOUND_API_KEY=${FREESOUND_API_KEY} + restart: unless-stopped + ports: + - "3100:3000" # app is running on 3000 so we run this at 3100 + environment: + - NODE_ENV=production + - DATABASE_URL=postgresql://opencut:opencutthegoat@db:5432/opencut + - BETTER_AUTH_URL=http://localhost:3000 + - BETTER_AUTH_SECRET=your-production-secret-key-here + - UPSTASH_REDIS_REST_URL=http://serverless-redis-http:80 + - UPSTASH_REDIS_REST_TOKEN=example_token + - FREESOUND_CLIENT_ID=${FREESOUND_CLIENT_ID} + - FREESOUND_API_KEY=${FREESOUND_API_KEY} + # Transcription (Optional - leave blank to disable auto-captions) + - CLOUDFLARE_ACCOUNT_ID=${CLOUDFLARE_ACCOUNT_ID} + - R2_ACCESS_KEY_ID=${R2_ACCESS_KEY_ID} + - R2_SECRET_ACCESS_KEY=${R2_SECRET_ACCESS_KEY} + - R2_BUCKET_NAME=${R2_BUCKET_NAME} + - MODAL_TRANSCRIPTION_URL=${MODAL_TRANSCRIPTION_URL} + depends_on: + db: + condition: service_healthy + serverless-redis-http: + condition: service_healthy + healthcheck: + test: ["CMD-SHELL", "curl -f http://localhost:3000/api/health || exit 1"] + interval: 30s + timeout: 10s + retries: 5 + start_period: 30s + +volumes: + postgres_data: + +networks: + default: + name: opencut-network diff --git a/src/postgres/README.md b/src/postgres/README.md index dad9206..f9a207d 100644 --- a/src/postgres/README.md +++ b/src/postgres/README.md @@ -14,7 +14,7 @@ This service deploys a PostgreSQL database. - `POSTGRES_USER`: The database username, default is `postgres`. - `POSTGRES_PASSWORD`: The database password, default is `postgres`. - `POSTGRES_DB`: The database name, default is `postgres`. -- `POSTGRES_PORT`: The host port for PostgreSQL, default is `5432`. +- `POSTGRES_PORT_OVERRIDE`: The host port for PostgreSQL, default is `5432`. ## Volumes diff --git a/src/postgres/README.zh.md b/src/postgres/README.zh.md index a4c9ef4..f70754a 100644 --- a/src/postgres/README.zh.md +++ b/src/postgres/README.zh.md @@ -14,7 +14,7 @@ - `POSTGRES_USER`: 数据库用户名,默认为 `postgres`。 - `POSTGRES_PASSWORD`: 数据库密码,默认为 `postgres`。 - `POSTGRES_DB`: 数据库名称,默认为 `postgres`。 -- `POSTGRES_PORT`: PostgreSQL 的主机端口,默认为 `5432`。 +- `POSTGRES_PORT_OVERRIDE`: PostgreSQL 的主机端口,默认为 `5432`。 ## 卷 diff --git a/src/postgres/docker-compose.yaml b/src/postgres/docker-compose.yaml index a06b994..d419f62 100644 --- a/src/postgres/docker-compose.yaml +++ b/src/postgres/docker-compose.yaml @@ -24,7 +24,7 @@ services: # Initialize the database with a custom SQL script # - ./init.sql:/docker-entrypoint-initdb.d/init.sql ports: - - "${POSTGRES_PORT:-5432}:5432" + - "${POSTGRES_PORT_OVERRIDE:-5432}:5432" deploy: resources: limits: