diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..6318835 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,213 @@ +version: '3' + +networks: + drone: + external: false + sentry: + external: false + nexus: + external: false + gitea: + external: false + +services: + smtp: + restart: unless-stopped + image: fgribreau/smtp-to-sendgrid-gateway + environment: + - SENDGRID_API=SENDGRID-API-KEY + networks: + - drone + - sentry + + drone-db: + image: postgres:10 + restart: always + environment: + - POSTGRES_USER=drone + - POSTGRES_PASSWORD=drone + - POSTGRES_DB=drone + networks: + - drone + volumes: + - ./drone-postgres:/var/lib/postgresql/data + + drone-server: + image: drone/drone:1 + volumes: + - ./drone_ci_data:/data + restart: always + networks: + - drone + ports: + - "127.0.0.1:880:80" + - "127.0.0.1:8443:443" + environment: + - DRONE_USER_CREATE=username:tormakris,admin:true + - DRONE_ADMIN=tormakris + - DRONE_AGENTS_ENABLED=true + - DRONE_GITEA_SERVER=https://git.kmlabz.com + - DRONE_GITEA_PRIVATE_MODE=true + - DRONE_SERVER_HOST=drone.kmlabz.com + - DRONE_SERVER_PROTO=https + - DRONE_GITEA_CLIENT_ID=GITEA-ID + - DRONE_GITEA_CLIENT_SECRET=GITEA-SECRET + - DRONE_RPC_SECRET=DRONE-SECRET + - DRONE_DATABASE_DRIVER=postgres + - DRONE_DATABASE_DATASOURCE=postgres://drone:drone@drone-db:5432/postgres?sslmode=disable + - DRONE_DATABASE_SECRET=DATABASE-SECRET + - DRONE_GITEA_SKIP_VERIFY=false + - DRONE_GIT_ALWAYS_AUTH=true + depends_on: + - drone-db + + drone-agent: + image: drone/agent:1 + restart: always + depends_on: [ drone-server ] + networks: + - drone + volumes: + - /var/run/docker.sock:/var/run/docker.sock + environment: + - DRONE_RPC_PROTO=https + - DRONE_RUNNER_CAPACITY=2 + - DRONE_RUNNER_NAME=celeron + - DRONE_RPC_HOST=drone.kmlabz.com + - DRONE_RPC_SECRET=DRONE-SECRET + + sentry-redis: + image: redis:5.0 + networks: + - sentry + + sentry-memcached: + image: memcached:1.5-alpine + networks: + - sentry + + sentry-postgres: + image: postgres:10 + environment: + POSTGRES_USER: sentry + POSTGRES_PASSWORD: sentry + POSTGRES_DB: sentry + networks: + - sentry + volumes: + - ./sentry_postgres:/var/lib/postgresql/data + + sentry: + image: sentry:9 + ports: + - "127.0.0.1:9000:9000" + networks: + - sentry + environment: + SENTRY_SECRET_KEY: 'SENTRY-SECRET' + SENTRY_POSTGRES_HOST: sentry-postgres + SENTRY_DB_USER: sentry + SENTRY_DB_PASSWORD: sentry + SENTRY_REDIS_HOST: sentry-redis + SENTRY_MEMCACHED_HOST: sentry-memcached + SENTRY_SERVER_EMAIL: sentry@kmlabz.com + SENTRY_EMAIL_HOST: smtp + depends_on: + - sentry-postgres + - sentry-redis + - sentry-memcached + - smtp + volumes: + - ./sentry-data:/var/lib/sentry/files + + sentry-cron: + image: sentry:9 + command: "sentry run cron" + networks: + - sentry + environment: + SENTRY_SECRET_KEY: 'SENTRY-SECRET' + SENTRY_POSTGRES_HOST: sentry-postgres + SENTRY_DB_USER: sentry + SENTRY_DB_PASSWORD: sentry + SENTRY_REDIS_HOST: sentry-redis + SENTRY_MEMCACHED_HOST: sentry-memcached + SENTRY_SERVER_EMAIL: sentry@kmlabz.com + SENTRY_EMAIL_HOST: stmp + depends_on: + - sentry-postgres + - sentry-redis + - sentry-memcached + - smtp + volumes: + - ./sentry-data:/var/lib/sentry/files + + sentry-worker: + image: sentry:9 + command: "sentry run worker" + networks: + - sentry + environment: + SENTRY_SECRET_KEY: 'SENTRY-SECRET' + SENTRY_POSTGRES_HOST: sentry-postgres + SENTRY_DB_USER: sentry + SENTRY_DB_PASSWORD: sentry + SENTRY_REDIS_HOST: sentry-redis + SENTRY_MEMCACHED_HOST: sentry-memcached + SENTRY_SERVER_EMAIL: sentry@kmlabz.com + SENTRY_EMAIL_HOST: smtp + depends_on: + - sentry-postgres + - sentry-redis + - sentry-memcached + - smtp + volumes: + - ./sentry-data:/var/lib/sentry/files + + nexus: + image: sonatype/nexus3 + networks: + - nexus + volumes: + - ./nexus-data:/nexus-data + ports: + - "127.0.0.1:8081:8081" + - "127.0.0.1:4269:4269" + depends_on: + - smtp + + gitea-db: + image: postgres:9.6 + restart: always + environment: + - POSTGRES_USER=gitea + - POSTGRES_PASSWORD=gitea + - POSTGRES_DB=gitea + networks: + - gitea + volumes: + - ./gitea-postgres:/var/lib/postgresql/data + + gitea-server: + image: gitea/gitea:1 + environment: + - USER_UID=1003 + - USER_GID=1003 + - DB_TYPE=postgres + - DB_HOST=gitea-db:5432 + - DB_NAME=gitea + - DB_USER=gitea + - DB_PASSWD=gitea + restart: always + networks: + - gitea + volumes: + - ./gitea:/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + ports: + - "127.0.0.1:3001:3000" + - "2222:22" + depends_on: + - gitea-db + - smtp