docker.recipes

OneDev All-in-One DevOps

intermediate

Self-hosted DevOps platform with Git, CI/CD, and project management.

Overview

OneDev is a self-hosted all-in-one DevOps platform that combines Git repository management, continuous integration/continuous deployment (CI/CD), and project management into a single cohesive solution. Created as an alternative to managing multiple disparate tools, OneDev provides built-in issue tracking, pull request workflows, build automation, and project boards while maintaining complete control over your development infrastructure. Unlike cloud-based solutions, OneDev runs entirely on your own infrastructure, ensuring data sovereignty and customization flexibility. This stack pairs OneDev with PostgreSQL to create a production-ready development platform. PostgreSQL serves as OneDev's primary database, storing Git metadata, issue tracking data, build configurations, and user management information. The combination leverages PostgreSQL's ACID compliance and robust transaction support to ensure data integrity across all DevOps operations, from code commits to build pipeline executions. PostgreSQL's advanced indexing and query optimization capabilities handle OneDev's complex relational queries for repository searches, build history analysis, and project reporting. This configuration is ideal for development teams seeking to consolidate their toolchain without sacrificing functionality or control. Organizations migrating from GitHub/GitLab combinations or those requiring on-premises DevOps solutions will find this stack particularly valuable. The setup provides enterprise-grade Git hosting, sophisticated CI/CD pipelines with YAML configuration, and integrated project management tools that rival commercial offerings while maintaining complete administrative control.

Key Features

  • Built-in Git server with advanced repository management and branch protection rules
  • YAML-based CI/CD pipelines with Docker-in-Docker build execution capabilities
  • Integrated issue tracking with customizable workflows and project boards
  • Pull request management with code review tools and merge conflict resolution
  • PostgreSQL-backed data persistence ensuring ACID compliance for all DevOps operations
  • SSH Git access on port 6611 for command-line repository operations
  • Docker socket mounting enabling containerized build environments
  • Comprehensive user management with role-based access control and team permissions

Common Use Cases

  • 1Small to medium development teams consolidating from multiple DevOps tools into a single platform
  • 2Organizations requiring on-premises Git hosting with integrated CI/CD capabilities
  • 3Companies migrating from cloud-based solutions to maintain data sovereignty and control
  • 4Development teams needing tight integration between source control and project management
  • 5Startups seeking enterprise DevOps functionality without per-user licensing costs
  • 6Educational institutions teaching DevOps practices with a complete, self-contained platform
  • 7Open source projects requiring robust hosting with integrated community contribution workflows

Prerequisites

  • Docker host with minimum 2GB RAM (OneDev requires 1GB+ and PostgreSQL needs 512MB+)
  • Available ports 6610 (OneDev web interface) and 6611 (SSH Git access)
  • Docker socket access for OneDev's containerized build system
  • POSTGRES_PASSWORD environment variable configured for database authentication
  • Basic understanding of Git workflows and CI/CD pipeline concepts
  • Sufficient disk space for Git repositories and build artifacts (recommend 20GB+ initial allocation)

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 postgres:
3 image: postgres:15-alpine
4 environment:
5 - POSTGRES_USER=onedev
6 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
7 - POSTGRES_DB=onedev
8 volumes:
9 - postgres_data:/var/lib/postgresql/data
10 networks:
11 - onedev_net
12
13 onedev:
14 image: 1dev/server:latest
15 ports:
16 - "6610:6610"
17 - "6611:6611"
18 environment:
19 - hibernate_dialect=io.onedev.server.persistence.PostgreSQLDialect
20 - hibernate_connection_driver_class=org.postgresql.Driver
21 - hibernate_connection_url=jdbc:postgresql://postgres:5432/onedev
22 - hibernate_connection_username=onedev
23 - hibernate_connection_password=${POSTGRES_PASSWORD}
24 volumes:
25 - onedev_data:/opt/onedev
26 - /var/run/docker.sock:/var/run/docker.sock
27 depends_on:
28 - postgres
29 networks:
30 - onedev_net
31
32volumes:
33 postgres_data:
34 onedev_data:
35
36networks:
37 onedev_net:

.env Template

.env
1# OneDev
2POSTGRES_PASSWORD=secure_postgres_password
3
4# OneDev at http://localhost:6610
5# SSH at localhost:6611
6# Complete setup wizard on first access

Usage Notes

  1. 1OneDev at http://localhost:6610
  2. 2SSH at port 6611
  3. 3Complete setup wizard first
  4. 4Built-in CI/CD with YAML
  5. 5Issue tracking and boards

Individual Services(2 services)

Copy individual services to mix and match with your existing compose files.

postgres
postgres:
  image: postgres:15-alpine
  environment:
    - POSTGRES_USER=onedev
    - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
    - POSTGRES_DB=onedev
  volumes:
    - postgres_data:/var/lib/postgresql/data
  networks:
    - onedev_net
onedev
onedev:
  image: 1dev/server:latest
  ports:
    - "6610:6610"
    - "6611:6611"
  environment:
    - hibernate_dialect=io.onedev.server.persistence.PostgreSQLDialect
    - hibernate_connection_driver_class=org.postgresql.Driver
    - hibernate_connection_url=jdbc:postgresql://postgres:5432/onedev
    - hibernate_connection_username=onedev
    - hibernate_connection_password=${POSTGRES_PASSWORD}
  volumes:
    - onedev_data:/opt/onedev
    - /var/run/docker.sock:/var/run/docker.sock
  depends_on:
    - postgres
  networks:
    - onedev_net

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 postgres:
5 image: postgres:15-alpine
6 environment:
7 - POSTGRES_USER=onedev
8 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
9 - POSTGRES_DB=onedev
10 volumes:
11 - postgres_data:/var/lib/postgresql/data
12 networks:
13 - onedev_net
14
15 onedev:
16 image: 1dev/server:latest
17 ports:
18 - "6610:6610"
19 - "6611:6611"
20 environment:
21 - hibernate_dialect=io.onedev.server.persistence.PostgreSQLDialect
22 - hibernate_connection_driver_class=org.postgresql.Driver
23 - hibernate_connection_url=jdbc:postgresql://postgres:5432/onedev
24 - hibernate_connection_username=onedev
25 - hibernate_connection_password=${POSTGRES_PASSWORD}
26 volumes:
27 - onedev_data:/opt/onedev
28 - /var/run/docker.sock:/var/run/docker.sock
29 depends_on:
30 - postgres
31 networks:
32 - onedev_net
33
34volumes:
35 postgres_data:
36 onedev_data:
37
38networks:
39 onedev_net:
40EOF
41
42# 2. Create the .env file
43cat > .env << 'EOF'
44# OneDev
45POSTGRES_PASSWORD=secure_postgres_password
46
47# OneDev at http://localhost:6610
48# SSH at localhost:6611
49# Complete setup wizard on first access
50EOF
51
52# 3. Start the services
53docker compose up -d
54
55# 4. View logs
56docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/onedev-devops/run | bash

Troubleshooting

  • OneDev startup fails with database connection errors: Ensure PostgreSQL container is fully initialized before OneDev starts, increase depends_on wait time if necessary
  • Git clone/push operations fail on port 6611: Verify SSH port 6611 is accessible and not blocked by firewall, check Docker host port binding configuration
  • Build pipelines fail with Docker socket errors: Confirm /var/run/docker.sock is properly mounted and accessible, ensure Docker daemon is running on host
  • OneDev web interface shows 'hibernate.dialect' errors: Verify PostgreSQL environment variables match OneDev's database connection settings exactly
  • Performance issues during large repository operations: Increase PostgreSQL shared_buffers and effective_cache_size, consider allocating more memory to both containers
  • Setup wizard repeatedly fails: Clear onedev_data volume and restart containers, ensure POSTGRES_PASSWORD is consistently set across both services

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space