How-to for Bitbucket Mirror in Docker container

This question is in reference to the docker Bitbucket server project here: https://bitbucket.org/atlassian/docker-atlassian-bitbucket-server/overview .  I'm running in "mirror mode" like this "APPLICATION_MODE=mirror" via a docker-compose environment setting.

By default, the container exposes ports 7990 and 7999 (http and ssh).  No mention of https.  When running as a mirror, however, https and a valid ssl cert is a firm requirement.

How do I configure the container to support https?

I'm using the current latest version (5.5.0).


Thanks for any help or tips.

2 answers

1 accepted

0 vote

Hi Trask,

Those settings are controlled in the bitbucket.properties file (see Bitbucket Server configuration properties for details), but the good news is that they are also exposed via environment variables.

For instance server.ssl.enabled=true becomes SERVER_SSL_ENABLED=true, likewise server.ssl.key-store becomes SERVER_SSL_KEY_STORE, etc.

Cheers,

Christian

Premier Support Engineer

Atlassian

Thanks Christian.  That lead me down the right path.  Below is my [redacted] {{docker-compose.yml}} file that might help others in the future.

I dug through a lot of documentation and wasn't aware that this was a way to accomplish setting up https-enabled mirror via docker.

 

Example for a BitBucket server in Mirror mode

docker-compose.yml

version: '2'
services:
  bitbucket-server:
    restart: always
    image: atlassian/bitbucket-server:5.5.0
    ports:
      - "192.168.8.15:443:7990"
      - "192.168.8.15:7999:7999"
    volumes:
      - "/media/RAID/bitbucket/bitbucket-server:/var/atlassian/application-data/bitbucket"
    environment:
      - APPLICATION_MODE=mirror
      - SERVER_REQUIRE_SSL=true
      - SERVER_REDIRECT_PORT=443
      - SERVER_SECURE=true
      - SERVER_SSL_ENABLED=true
      - SERVER_SSL_KEY_PASSWORD=xXxXxXx
      - SERVER_SSL_KEY_STORE_PASSWORD=xXxXxXx
      - SERVER_SSL_KEY_ALIAS=tomcat
      - SERVER_SSL_KEY_STORE=/var/atlassian/application-data/bitbucket/shared/config/ssl-keystore

I should mention I have valid certs and can handle the certificate configuration once I find out how to configure https support in the built-in http server.

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

716 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot