The default database engine of Woodpecker is an embedded SQLite database which requires zero installation or configuration. But you can replace it with a MySQL or Postgres database.
By default Woodpecker uses a sqlite database stored under
/var/lib/woodpecker/. You can mount a data volume to persist the sqlite database.
+ - woodpecker-server-data:/var/lib/woodpecker/
The below example demonstrates mysql database configuration. See the official driver documentation for configuration options and examples.
+ WOODPECKER_DATABASE_DRIVER: mysql
+ WOODPECKER_DATABASE_DATASOURCE: root:password@tcp(220.127.116.11:3306)/woodpecker?parseTime=true
The below example demonstrates postgres database configuration. See the official driver documentation for configuration options and examples. Please use postgres versions equal or higher than 11.
+ WOODPECKER_DATABASE_DRIVER: postgres
+ WOODPECKER_DATABASE_DATASOURCE: postgres://root:email@example.com:5432/postgres?sslmode=disable
Woodpecker does not create your database automatically. If you are using the mysql or postgres driver you will need to manually create your database using
Woodpecker automatically handles database migration, including the initial creation of tables and indexes. New versions of Woodpecker will automatically upgrade the database unless otherwise specified in the release notes.
Woodpecker does not perform database backups. This should be handled by separate third party tools provided by your database vendor of choice.
Woodpecker does not perform data archival; it considered out-of-scope for the project. Woodpecker is rather conservative with the amount of data it stores, however, you should expect the database logs to grow the size of your database considerably.