Skip to content

Instantly share code, notes, and snippets.

@roberthamel
Forked from joffilyfe/README.md
Created February 3, 2020 04:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roberthamel/e77fa2554638ae73300be137a6ba26f4 to your computer and use it in GitHub Desktop.
Save roberthamel/e77fa2554638ae73300be137a6ba26f4 to your computer and use it in GitHub Desktop.
GITEA + Drone (0.7|0.8)

Compose file to setup and host a Gitea and Drone environment

This environment is dependent off a common network for docker/git plugin and gitea-server, so for this work fine in closed networks we have to create a custom network before run this composefile.

First create your network:

docker network create gitea-network

Now you have to setup this network as a environment variable:

export DEFAULT_NETWORK=gitea-network

Fine, we finally can ran our services:

docker-compose up

Now you can see your gitea server at port 8380 and your drone server ate 8381.

APP_NAME = Repository
RUN_USER = git
RUN_MODE = prod
[repository]
ROOT = /data/git/repositories
[repository.upload]
TEMP_PATH = /data/gitea/uploads
[server]
APP_DATA_PATH = /data/gitea
SSH_DOMAIN = gitea-server
DOMAIN = gitea-server
HTTP_PORT = 3000
ROOT_URL = http://gitea-server:3000/
DISABLE_SSH = false
SSH_PORT = 22
LFS_START_SERVER = false
OFFLINE_MODE = false
[database]
DB_TYPE = postgres
PATH = /data/gitea/gitea.db
HOST = gitea-db:5432
NAME = gitea
USER = postgres
PASSWD = test
SSL_MODE = disable
[session]
PROVIDER_CONFIG = /data/gitea/sessions
PROVIDER = file
[picture]
AVATAR_UPLOAD_PATH = /data/gitea/avatars
DISABLE_GRAVATAR = false
ENABLE_FEDERATED_AVATAR = false
[attachment]
PATH = /data/gitea/attachments
[log]
ROOT_PATH = /data/gitea/log
MODE = file
LEVEL = Info
[security]
INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE1MDY2MjE1NTl9.g90qwYjtDllcoYP1uIGzMbZR7PGJDbC0RiGi5euZRl8
INSTALL_LOCK = true
SECRET_KEY = BrodT3IweV
[mailer]
ENABLED = false
[service]
REGISTER_EMAIL_CONFIRM = false
ENABLE_NOTIFY_MAIL = false
DISABLE_REGISTRATION = false
ENABLE_CAPTCHA = false
REQUIRE_SIGNIN_VIEW = false
DEFAULT_KEEP_EMAIL_PRIVATE = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING = true
NO_REPLY_ADDRESS = noreply.example.org
[openid]
ENABLE_OPENID_SIGNIN = false
ENABLE_OPENID_SIGNUP = false
version: '2'
volumes:
gitea-data:
db:
drone-db:
networks:
default:
external:
name: ${DEFAULT_NETWORK}
services:
gitea-server:
image: gitea/gitea:latest
ports:
- 8380:3000
volumes:
- gitea-data:/data
- ./data:/data/gitea
restart: always
external_links:
- gitea-db
depends_on:
- gitea-db
gitea-db:
image: postgres:alpine
ports:
- 5440:5432
restart: always
volumes:
- db:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=test
- POSTGRES_DB=gitea
drone-server:
image: drone/drone:0.7
ports:
- 8381:8000
volumes:
- drone-db:/var/lib/drone/
restart: always
environment:
- DRONE_OPEN=true
- DRONE_HOST=http://drone-server:8381
- DRONE_SECRET=test
- DRONE_GITEA=true
- DRONE_GITEA_URL=http://gitea-server:3000/
- DRONE_NETWORK=${DEFAULT_NETWORK}
depends_on:
- gitea-server
drone-agent:
image: drone/drone:0.7
command: agent
restart: always
depends_on:
- drone-server
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- DRONE_SERVER=ws://drone-server:8000/ws/broker
- DRONE_SECRET=test
version: '2'
volumes:
gitea-data:
db:
drone-db:
networks:
default:
external:
name: ${DEFAULT_NETWORK}
services:
gitea-server:
image: gitea/gitea:latest
ports:
- 8380:3000
volumes:
- gitea-data:/data
- ./data:/data/gitea
restart: always
external_links:
- gitea-db
depends_on:
- gitea-db
gitea-db:
image: postgres:alpine
ports:
- 5440:5432
restart: always
volumes:
- db:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=test
- POSTGRES_DB=gitea
drone-server:
image: drone/drone:0.8
ports:
- 8381:8000
- 9000:9000
volumes:
- drone-db:/var/lib/drone/
restart: always
environment:
- DRONE_OPEN=true
- DRONE_HOST=http://drone-server:8381
- DRONE_SECRET=test
- DRONE_GITEA=true
- DRONE_GITEA_URL=http://gitea-server:3000/
- DRONE_NETWORK=${DEFAULT_NETWORK}
depends_on:
- gitea-server
drone-agent:
image: drone/agent:0.8
command: agent
restart: always
depends_on:
- drone-server
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- DRONE_SERVER=drone-server:9000
- DRONE_SECRET=test
import unittest
class Main(unittest.TestCase):
def test_some(self):
self.assertTrue(True)
self.assertFalse(False)
self.assertTrue(True)
if __name__ == '__main__':
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment