From 54ef176fe5e9bc183767025cbb76265a0b56f420 Mon Sep 17 00:00:00 2001 From: Atridad Lahiji Date: Mon, 18 Nov 2024 17:34:30 -0600 Subject: [PATCH] Re-vamped the compose files --- compose/docuseal.yml | 15 ++++---- compose/formbricks.yml | 75 ------------------------------------ compose/git.runner.yml | 11 ++++++ compose/git.yml | 84 ++++++++++------------------------------- compose/uptime.yml | 10 ++--- compose/vaultwarden.yml | 20 ++++++++++ 6 files changed, 61 insertions(+), 154 deletions(-) delete mode 100644 compose/formbricks.yml create mode 100644 compose/git.runner.yml create mode 100644 compose/vaultwarden.yml diff --git a/compose/docuseal.yml b/compose/docuseal.yml index ff8ace5..9ee3388 100644 --- a/compose/docuseal.yml +++ b/compose/docuseal.yml @@ -5,16 +5,15 @@ services: condition: service_healthy image: docuseal/docuseal:latest ports: - - 3069:3000 - volumes: - - ./docuseal:/data/docuseal + - '3069:3000' environment: - - DATABASE_URL=postgresql://postgres:postgres@postgres:5432/docuseal + DATABASE_URL: postgresql://postgres:postgres@postgres:5432/docuseal + ROOT_DIR: ${ROOT_DIR} + volumes: + - ${ROOT_DIR}/app_data:/data/docuseal postgres: image: postgres:15 - volumes: - - './pg_data:/var/lib/postgresql/data' environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres @@ -23,4 +22,6 @@ services: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 5s - retries: 5 \ No newline at end of file + retries: 5 + volumes: + - ${ROOT_DIR}/pg_data:/var/lib/postgresql/data \ No newline at end of file diff --git a/compose/formbricks.yml b/compose/formbricks.yml deleted file mode 100644 index a4433b2..0000000 --- a/compose/formbricks.yml +++ /dev/null @@ -1,75 +0,0 @@ -version: "3.3" -x-environment: &environment - environment: - WEBAPP_URL: ${WEBAPP_URL} - NEXTAUTH_URL: ${WEBAPP_URL} - - # PostgreSQL DB for Formbricks to connect to - DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/formbricks?schema=public" - - # NextJS Auth - # @see: https://next-auth.js.org/configuration/options#nextauth_secret - # You can use: `openssl rand -hex 32` to generate one - NEXTAUTH_SECRET: ${NEXTAUTH_SECRET} - - # Encryption Key is used for 2FA & Single use URLs for Link Surveys - # You can use: $(openssl rand -hex 32) to generate one - ENCRYPTION_KEY: ${ENCRYPTION_KEY} - - # API Secret for running cron jobs. - # You can use: $(openssl rand -hex 32) to generate a secure one - CRON_SECRET: ${CRON_SECRET} - - # Email Configuration - MAIL_FROM: ${MAIL_FROM} - SMTP_HOST: ${SMTP_HOST} - SMTP_PORT: ${SMTP_PORT} - SMTP_USER: ${SMTP_USER} - SMTP_PASSWORD: ${SMTP_PASSWORD} - - SMTP_SECURE_ENABLED: 1 - - # Set the below to 0 to enable Email Verification for new signups (will required Email Configuration) - EMAIL_VERIFICATION_DISABLED: 1 - - # Set the below to 0 to enable Password Reset (will required Email Configuration) - PASSWORD_RESET_DISABLED: 1 - -services: - postgres: - restart: always - image: postgres:15-alpine - volumes: - - postgres:/var/lib/postgresql/data - environment: - # Postgres DB Super User Password - # Replace the below with your own secure password & Make sure the password matches the password field in DATABASE_URL above - - POSTGRES_PASSWORD=postgres - - formbricks: - restart: always - image: ghcr.io/formbricks/formbricks:latest - depends_on: - - postgres - ports: - - 3333:3000 - volumes: - - uploads:/home/nextjs/apps/web/uploads/ - <<: *environment - -volumes: - postgres: - driver: local - uploads: -# Example dotend env -# WEBAPP_URL=https://formbricks.example.com -# NEXTAUTH_URL=https://formbricks.example.com -# DATABASE_URL=postgresql://postgres:postgres@postgres:5432/formbricks?schema=public -# NEXTAUTH_SECRET=secret -# ENCRYPTION_KEY=secret -# CRON_SECRET=secret -# MAIL_FROM=noreply@example.com -# SMTP_HOST=smtp.example.com -# SMTP_PORT=587 -# SMTP_USER=user@example.com -# SMTP_PASSWORD=password diff --git a/compose/git.runner.yml b/compose/git.runner.yml new file mode 100644 index 0000000..607e27a --- /dev/null +++ b/compose/git.runner.yml @@ -0,0 +1,11 @@ +services: + runner: + image: gitea/act_runner:nightly + environment: + GITEA_INSTANCE_URL: ${INSTANCE_URL} + GITEA_RUNNER_REGISTRATION_TOKEN: ${REGISTRATION_TOKEN} + GITEA_RUNNER_NAME: ${RUNNER_NAME} + ROOT_DIR: ${ROOT_DIR} + volumes: + - ${ROOT_DIR}:/data + - /var/run/docker.sock:/var/run/docker.sock \ No newline at end of file diff --git a/compose/git.yml b/compose/git.yml index 17a4dd7..5351a0a 100644 --- a/compose/git.yml +++ b/compose/git.yml @@ -1,28 +1,19 @@ -# Create a secret with: -# -# openssl rand -hex 20 - services: - - docker-in-docker: - image: code.forgejo.org/oci/docker:dind - hostname: docker - privileged: true + postgres: + image: postgres:17-alpine environment: - DOCKER_TLS_CERTDIR: /certs - DOCKER_HOST: docker-in-docker + POSTGRES_USER: ${POSTGRES_USER} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + POSTGRES_DB: forgejo volumes: - - ${ROOT_DIR}/docker_certs:/certs + - ${ROOT_DIR}/postgres_data:/var/lib/postgresql/data + ports: + - "5432:5432" forgejo: - image: codeberg.org/forgejo/forgejo:8 - command: >- - bash -c ' - /bin/s6-svscan /etc/s6 & - sleep 10 ; - su -c "forgejo forgejo-cli actions register --secret ${SHARED_SECRET}" git ; - sleep infinity - ' + image: codeberg.org/forgejo/forgejo:9 + depends_on: + - postgres environment: FORGEJO__security__INSTALL_LOCK: "true" FORGEJO__log__LEVEL: "debug" @@ -31,53 +22,16 @@ services: FORGEJO__repository__DEFAULT_REPO_UNITS: "repo.code,repo.actions" FORGEJO__server__ROOT_URL: https://${ROOT_URL} FORGEJO__server__SSH_DOMAIN: ${ROOT_URL} - FORGEJO__server__SSH_PORT: 2222 + FORGEJO__server__SSH_PORT: 69 FORGEJO__server__START_SSH_SERVER: false - + # PostgreSQL configuration + FORGEJO__database__DB_TYPE: postgres + FORGEJO__database__HOST: postgres:5432 + FORGEJO__database__NAME: forgejo + FORGEJO__database__USER: ${POSTGRES_USER} + FORGEJO__database__PASSWD: ${POSTGRES_PASSWORD} volumes: - ${ROOT_DIR}/forgejo_data:/data ports: - '8080:3000' - - '2222:2222' - - runner-register: - image: code.forgejo.org/forgejo/runner:3.4.1 - links: - - docker-in-docker - - forgejo - environment: - DOCKER_HOST: tcp://docker-in-docker:2376 - volumes: - - ${ROOT_DIR}/runner_data:/data - user: 0:0 - command: >- - bash -ec ' - while : ; do - forgejo-runner create-runner-file --connect --instance http://forgejo:3000 --name runner --secret ${SHARED_SECRET} && break ; - sleep 1 ; - done ; - sed -i -e "s|\"labels\": null|\"labels\": [\"docker:docker://code.forgejo.org/oci/alpine:3.18\", \"ubuntu-latest:docker://catthehacker/ubuntu:act-22.04\"]|" .runner ; - forgejo-runner generate-config > config.yml ; - sed -i -e "s|network: .*|network: host|" config.yml ; - sed -i -e "s|^ envs:$$| envs:\n DOCKER_HOST: tcp://docker:2376\n DOCKER_TLS_VERIFY: 1\n DOCKER_CERT_PATH: /certs/client|" config.yml ; - sed -i -e "s|^ options:| options: -v /certs/client:/certs/client|" config.yml ; - sed -i -e "s| valid_volumes: \[\]$$| valid_volumes:\n - /certs/client|" config.yml ; - chown -R 1000:1000 /data - ' - - runner-daemon: - image: code.forgejo.org/forgejo/runner:3.4.1 - links: - - docker-in-docker - - forgejo - environment: - DOCKER_HOST: tcp://docker:2376 - DOCKER_CERT_PATH: /certs/client - DOCKER_TLS_VERIFY: "1" - volumes: - - ${ROOT_DIR}/runner_data:/data - - ${ROOT_DIR}/docker_certs:/certs - command: >- - bash -c ' - while : ; do test -w .runner && forgejo-runner --config config.yml daemon ; sleep 1 ; done - ' + - '69:22' \ No newline at end of file diff --git a/compose/uptime.yml b/compose/uptime.yml index 15bc437..fb08378 100644 --- a/compose/uptime.yml +++ b/compose/uptime.yml @@ -5,11 +5,7 @@ services: image: "louislam/uptime-kuma:1" ports: - "17958:3001" - networks: - - proxy + environment: + ROOT_DIR: ${ROOT_DIR} volumes: - - "./uptimekuma_data:/app/data" - -networks: - proxy: - external: true + - "${ROOT_DIR}:/app/data" diff --git a/compose/vaultwarden.yml b/compose/vaultwarden.yml new file mode 100644 index 0000000..d5789b8 --- /dev/null +++ b/compose/vaultwarden.yml @@ -0,0 +1,20 @@ +services: + vaultwarden: + image: vaultwarden/server:latest + container_name: vaultwarden + restart: unless-stopped + ports: + - '9445:80' + environment: + ADMIN_TOKEN: ${ADMIN_TOKEN} + WEBSOCKET_ENABLED: true + SIGNUPS_ALLOWED: false + SMTP_HOST: ${SMTP_HOST} + SMTP_FROM: ${SMTP_FROM} + SMTP_PORT: ${SMTP_PORT} + SMTP_SSL: ${SMTP_SSL} + SMTP_USERNAME: ${SMTP_USERNAME} + SMTP_PASSWORD: ${SMTP_PASSWORD} + DOMAIN: ${DOMAIN} + volumes: + - ${ROOT_DIR}:/data:rw \ No newline at end of file