add functionnal version of drone-ci

master
greglebreton 2 years ago
parent ecd7a4a9c4
commit 2eb2505a98
  1. 99
      docker-compose.yml

@ -1,79 +1,110 @@
version: "2" version: "2"
services: services:
gitea-app:
image: gitea/gitea:latest # GITEA
container_name: gitea-app gitea-web:
image: gitea/gitea:1.16.9
container_name: gitea
restart: always
env_file:
- ./.env
environment: environment:
- USER_UID=1000 - USER_UID=1000
- USER_GID=1000 - USER_GID=1000
- ROOT_URL=http://gitea:3000 - GITEA__database__DB_TYPE=postgres
- SSH_DOMAIN=mydomain.com - GITEA__database__HOST=gitea-db:5432
restart: always - GITEA__database__NAME=${POSTGRES_DB}
- GITEA__database__USER=${POSTGRES_USER}
- GITEA__database__PASSWD=${POSTGRES_PASSWORD}
networks:
- gitea
volumes: volumes:
- ./volumes/gitea_app:/data - ./gitea:/data
- ./config:/etc/gitea
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports: ports:
- "3000:3000" - "3000:3000"
- "22:22" - "${SSH_PORT}:22"
networks: depends_on:
- gitea - gitea-db
gitea-db: gitea-db:
image: postgres:alpine image: postgres:14
container_name: gitea-db container_name: gitea-db
ports:
- 5440:5432
restart: always restart: always
volumes: env_file:
- ./volumes/gitea_db:/var/lib/postgresql/data - ./.env
environment: environment:
- POSTGRES_USER=postgres - POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=postgres - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=gitea - POSTGRES_DB=${POSTGRES_DB}
networks: networks:
- gitea - gitea
volumes:
- ./postgres:/var/lib/postgresql/data
# DRONE SERVER
drone-server: drone-server:
image: drone/drone:0.8 image: drone/drone:2.16
container_name: drone-server container_name: drone-server
ports: ports:
- 80:8000 - "3001:80"
- 9000 - "9001:9000"
volumes: volumes:
- ./volumes/drone-srv:/var/lib/drone/ - ./volumes/drone-srv:/var/lib/drone/
restart: always restart: always
depends_on:
- gitea
environment: environment:
- DRONE_OPEN=true - DRONE_OPEN=true
- DRONE_HOST=http://drone-server:8000 - DRONE_SERVER_HOST=drone.${DOMAIN}
- DRONE_GITEA=true - DRONE_GITEA=true
- DRONE_GITEA_URL=http://gitea:3000 - DRONE_GITEA_SERVER=${DRONE_GITEA_SERVER}
- DRONE_SECRET=secret
- DRONE_NETWORK=gitea - DRONE_NETWORK=gitea
- DRONE_GITEA_SKIP_VERIFY=true
- DRONE_TLS_AUTOCERT=false
- DRONE_GITEA_GIT_USERNAME=${DRONE_GITEA_GIT_USERNAME}
- DRONE_GITEA_GIT_PASSWORD=${DRONE_GITEA_GIT_PASSWORD}
- DRONE_GIT_USERNAME=${DRONE_GITEA_GIT_USERNAME}
- DRONE_GIT_PASSWORD=${DRONE_GITEA_GIT_PASSWORD}
- DRONE_RPC_SECRET=${DRONE_RPC_SECRET}
- DRONE_GITEA_CLIENT_ID=${DRONE_GITEA_CLIENT_ID}
- DRONE_GITEA_CLIENT_SECRET=${DRONE_GITEA_CLIENT_SECRET}
- DRONE_ADMIN=${DRONE_ADMIN}
- DRONE_USER_CREATE="username:${DRONE_GITEA_GIT_USERNAME},machine:false,admin:true,token:${DRONE_RPC_SECRET}"
- DRONE_SERVER_PROTO=https
networks: networks:
- gitea - gitea
drone-agent: # DRONE RUNNER
image: drone/agent:0.8 drone-runner:
container_name: drone-agent image: drone/drone-runner-docker:1.8.2
command: agent container_name: drone-runner
restart: always restart: always
depends_on: depends_on:
- drone-server - drone-server
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
- ./drone-runner:/drone/src
environment: environment:
- DRONE_SERVER=drone-server:9000 - DRONE_RPC_HOST=drone.${DOMAIN}
- DRONE_SECRET=secret - DRONE_RPC_SECRET=${DRONE_RPC_SECRET}
- DRONE_RPC_PROTO=https
- DRONE_RUNNER_NAME="drone-runner"
- DRONE_RUNNER_CAPACITY=2
- DRONE_RUNNER_VOLUMES=/var/run/docker.sock:/var/run/docker.sock
ports:
- "3002:3000"
networks: networks:
- gitea - gitea
volumes: volumes:
gitea-app:
gitea-db: gitea-db:
drone-srv: drone-srv:
drone-runner:
networks: networks:
gitea: gitea:
external: true name: gitea
Loading…
Cancel
Save