-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (36 loc) · 2.21 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM openjdk:11-jre-slim
# Setup useful environment variables
ENV BITBUCKET_HOME /var/atlassian/bitbucket
ENV BITBUCKET_INSTALL /opt/atlassian/bitbucket
ENV BITBUCKET_VERSION 6.1.3
ENV MYSQL_CONNECTOR_VERSION 5.1.47
# Install Atlassian Bitbucket and helper tools and setup initial home
# directory structure.
RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends ttf-dejavu git curl procps \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p "${BITBUCKET_HOME}/shared" \
&& touch "${BITBUCKET_HOME}/shared/bitbucket.properties" \
&& chmod -R 700 "${BITBUCKET_HOME}" \
&& chown -R daemon:daemon "${BITBUCKET_HOME}" \
&& mkdir -p "${BITBUCKET_INSTALL}/elasticsearch/logs" \
&& chown -R daemon:daemon "${BITBUCKET_INSTALL}/elasticsearch/logs" \
&& curl -Ls "https://www.atlassian.com/software/stash/downloads/binary/atlassian-bitbucket-${BITBUCKET_VERSION}.tar.gz" | tar -zx --directory "${BITBUCKET_INSTALL}" --strip-components=1 --no-same-owner \
&& curl -Ls "https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-${MYSQL_CONNECTOR_VERSION}.tar.gz" | tar -xz --directory "${BITBUCKET_INSTALL}/app/WEB-INF/lib" --strip-components=1 --no-same-owner "mysql-connector-java-${MYSQL_CONNECTOR_VERSION}/mysql-connector-java-${MYSQL_CONNECTOR_VERSION}-bin.jar"
# Use the default unprivileged account. This could be considered bad practice
# on systems where multiple processes end up being executed by 'daemon' but
# here we only ever run one process anyway.
USER daemon:daemon
# Expose default HTTP and SSH ports.
EXPOSE 7990 7999
# Set volume mount points for installation and home directory. Changes to the
# home directory needs to be persisted as well as parts of the installation
# directory due to eg. logs.
VOLUME ["/var/atlassian/bitbucket","/opt/atlassian/bitbucket/logs"]
# Set the default working directory as the Bitbucket home directory.
WORKDIR /var/atlassian/bitbucket
COPY "docker-entrypoint.sh" "/"
ENTRYPOINT ["/docker-entrypoint.sh"]
# Run Atlassian Bitbucket as a foreground process by default.
CMD ["/opt/atlassian/bitbucket/bin/start-bitbucket.sh", "-fg"]