How-to for Bitbucket Mirror in Docker container

trask_ts3d November 1, 2017

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

1 vote
Answer accepted
Christian Glockner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 2, 2017

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

trask_ts3d November 2, 2017

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
Like Aaditya Srinivasan likes this
0 votes
trask_ts3d November 1, 2017

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 Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events