Dockerfile for RhodeCode Control, ready-to-go for VCS Server, RhodeCode Community Edition and RhodeCode Enterprise Edition.
For more details, see https://github.com/ckulka/rhodecode-rccontrol.
I follow the same naming scheme for the images as RhodeCode themselves
The following steps are required to spin up a complete RhodeCode stack
- Initialise the database
- Spin up the VCS Server and RhodeCode CE/EE
version: "3"
services:
db:
image: postgres:alpine
environment:
POSTGRES_PASSWORD: cookiemonster
vcsserver:
image: ckulka/rhodecode-vcsserver
rhodecode:
image: ckulka/rhodecode-ce
environment:
RC_DB: postgresql://postgres:cookiemonster@db
ports:
- "5000:5000"
links:
- db
- vcsserverSee example/docker-compose.yaml for a complete example including volumes for persistence.
# Spin up the database
docker-compose up -d db
# Run the installer for RhodeCode to initialise the database
docker-compose run --rm rhodecode ./install.sh
# Alternatively, if you haven't defined RC_DB
docker-compose run --rm rhodecode ./install.sh <database>
# Spin up the VCS Server and RhodeCode after the installation
docker-compose up -dYou can now open http://localhost:5000 and sign in using the admin username and the password ilovecookies.
The RC_DB variable specifies the database RhodeCode connects to.
It's only there for convenience over RC_CONFIG and takes precendence over sqlalchemy.db1.url in RC_CONFIG.
For more details on supported databases, see Supported Databases.
This variable is only used in the RhodeCode CE and EE.
The RC_CONFIG variable updates the VCS Server or Rhodecode CE/EE configuration, adding/updating settings that were set or not available during installation.
If RC_CONF is not set, the contents of files/rhodecode.override.ini is used by default.
The example below additionally sets up the email configuration.
rhodecode:
image: ckulka/rhodecode-ce
environment:
RC_DB: postgresql://postgres:cookiemonster@db
RC_CONFIG: |
[DEFAULT]
email_to = [email protected]
error_email_from = rhodecode_error@localhost
app_email_from = [email protected]
smtp_server = mail.example.com
smtp_use_ssl = true
[app:main]
vcs.server.enable = true
vcs.server = vcsserver:9900For more details on the configuration, see Post Installation Tasks.
RhodeCode is configured to use /data as the location for the respositories.
Only the VCS Server needs to have access to the repository files, as depicted in the System Overview.
For more details on how to back up the repositories, see Repository Backup.
WIP: While it sounds like it makes sense, I still have to test it.
Migrating an existing installation of RhodeCode to Docker is essentially described in Backup and Restore: Restoration Steps
- Spin up a new instance
- Mount your existing repositories
- Use
RC_CONFIGto import your existing configuration
- Remap and rescan your repositories
- Perform any necessary Post Restoration Steps
version: "3"
services:
vcsserver:
image: ckulka/rhodecode-vcsserver
volumes:
- /mnt/repositories:/data
rhodecode:
image: ckulka/rhodecode-ce
environment:
RC_CONFIG: |
[app:main]
vcs.server.enable = true
vcs.server = vcsserver:9900
sqlalchemy.db1.url = postgresql://rhodecode:secret@mydbserver/rhodecode
# ...
ports:
- "5000:5000"