-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (35 loc) · 1.48 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
45
FROM openjdk:8u121-alpine
LABEL maintainer="Remon Lam <[email protected]>"
# Setting environment variables
ENV BITBUCKET_VERSION=6.7.0
ENV JVM_MINIMUM_MEMORY="512m"
ENV JVM_MAXIMUM_MEMORY="4G"
# NOTE: depending on the deployment size JVM memory settings should be tuned
ENV RUN_USER daemon
ENV RUN_GROUP daemon
# https://confluence.atlassian.com/display/BitbucketServer/Bitbucket+Server+home+directory
ENV BITBUCKET_HOME /var/atlassian/application-data/bitbucket
ENV BITBUCKET_INSTALL_DIR /opt/atlassian/bitbucket
ENV CONF_VERSION 6.3.0
# Setting variables used at container build
ARG DOWNLOAD_URL=https://product-downloads.atlassian.com/software/stash/downloads/atlassian-bitbucket-${BITBUCKET_VERSION}.tar.gz
# Installing dependencies
RUN apk update -qq \
&& update-ca-certificates \
&& apk add ca-certificates wget curl git openssh bash procps openssl perl ttf-dejavu tini \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/ /tmp/* /var/tmp/*
# Copy the entryfile and rename it to 'entrypoint'
# NOTE: entrypoint needs to be executable...
COPY entrypoint.sh /entrypoint
# Install Bitbucket
RUN mkdir -p ${BITBUCKET_INSTALL_DIR} \
&& curl -L --silent ${DOWNLOAD_URL} | tar -xz --strip-components=1 -C "$BITBUCKET_INSTALL_DIR" \
&& chown -R ${RUN_USER}:${RUN_GROUP} ${BITBUCKET_INSTALL_DIR}/
VOLUME ["${BITBUCKET_HOME}"]
# Expose the HTTP and SSH ports
EXPOSE 7990
EXPOSE 7999
# Set working directory
WORKDIR $BITBUCKET_HOME
CMD ["/entrypoint", "-fg"]
ENTRYPOINT ["/sbin/tini", "--"]