From 91205e913bfe0918a35ceb10c9e8e1d038ea74af Mon Sep 17 00:00:00 2001 From: Herwin Date: Sun, 21 Nov 2021 03:15:56 +0100 Subject: [PATCH] Initial commit Update Dockerfile, docker-compose.yml, and readme.md --- Dockerfile | 31 +++++++++++++++++++++++++++++++ docker-compose.yml | 20 ++++++++++++++++++++ readme.md | 21 +++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 readme.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c1f2e6c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +FROM bitnami/minideb:latest + +# Preparing the folders and installing packages. +RUN mkdir /gitbucket /java && apt-get update && apt-get -y install bash wget + +# Uncomment if you are using a plugin that requires Git to be installed. +# RUN apt-get -y install git + +# Downloading and extracting Temurin 17.0.1+12 from Adoptium. +RUN wget -q -O /java/openjdk.tar.gz "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.1%2B12/OpenJDK17U-jdk_aarch64_linux_hotspot_17.0.1_12.tar.gz" +RUN tar -xf /java/openjdk.tar.gz -C /java && mv /java/jdk-17.0.1+12 /java/jdk && rm -f /java/openjdk.tar.gz + +# Setting up Java's environment variables +ENV JAVA_HOME /java/jdk +ENV PATH $PATH:/java/jdk/bin + +# Downloading gitBucket 4.36.2 +RUN wget -q -O /gitbucket/gitbucket.war "https://github.com/gitbucket/gitbucket/releases/download/4.36.2/gitbucket.war" + +# Setting up required GitBucket's environment variables +ENV GITBUCKET_HOME /gitbucket/gitbucket_data +ENV DATABASE_URL jdbc:h2:/gitbucket/gitbucket_daya/data;MVCC=true + +# Exposing HTTP and SSH ports +EXPOSE 8080 +EXPOSE 8443 + +# Running the application +# You can remove the "-Xms128m" and "-Xmx256m" arguments if you need to support more than a couple concurent users. +WORKDIR /gitbucket +CMD ["java", "-Xms128m", "-Xmx256m", "-jar", "/gitbucket/gitbucket.war"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..3475a51 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +version: "3.3" + +services: + gitbucket: + container_name: gitbucket + build: + context: . + dockerfile: Dockerfile + ports: + - 30880:8080 + #- 30022:8443 # HTTPS port ? + - 30022:29418 + volumes: + - ./data:/gitbucket/gitbucket_data + environment: + # Does not work, for some reason. + GITBUCKET_MAXFILESIZE: 67108864 + restart: unless-stopped + tty: true # Can be commented if you don't intend to use a shell in the container. + stdin_open: true # Can also be commented for the same reason as above. diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..360aa89 --- /dev/null +++ b/readme.md @@ -0,0 +1,21 @@ +# Docker - GitBucket +A simple docker-compose file that can be used to create a *GitBucket* container on SBCs. + +## Requirements +__CPU Architecture:__ ARM64 (Use the official image for AMD64)
+__RAM:__ At least 256 MiB + +## Remarks +This container is not intended to be used with an external database and forces *GitBucket* to use a local DB.
+However, it should be relatively easy to use an external one if you change the `DATABASE_URL` environment variable. + +## Building +In order to build this container, all you have to do is to clone this repository and run `docker-compose up`. + +## Configuration +TODO. + +## License +[License](LICENSE) + +This license does not apply to *GitBucket*, *Java* and any of the other applications used by this container.