Split database from application. Update Redmine to 3.2.1

This commit is contained in:
Andres 2016-03-15 12:44:59 +01:00
parent 85758a0399
commit e7d0bc0a96
8 changed files with 505 additions and 166 deletions

3
bitnami/redmine/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
.*.swp
\#*#
*~

View File

@ -1,19 +1,24 @@
FROM bitnami/base-apps-ubuntu:14.04
FROM gcr.io/stacksmith-images/ubuntu:14.04-r05
MAINTAINER Bitnami <containers@bitnami.com>
# Runtime
RUN RUBY_PACKAGE_SHA256="7e2ba51497ee7594f4dd080dcfcb8fcbe9a974fc7fea7bf8481b6998b959e058" bitnami-pkg install ruby-2.1.8-5
ENV PATH=/opt/bitnami/ruby/bin:$PATH
# Additional modules required
RUN IMAGEMAGICK_PACKAGE_SHA256="abed4e406b509206a834c104a750762c4fc7fd223a1a2231c7fd15320fb9734f" bitnami-pkg install imagemagick-6.7.5-10-0
RUN MYSQL_LIBRARIES_PACKAGE_SHA256="55cc1e7fd1bb56e34d9e9478963e30e39ad8728dcce58b39b5c40d24149f62f6" bitnami-pkg install mysql-libraries-10.1.11-0
RUN MYSQL_CLIENT_PACKAGE_SHA256="ac289d099bd00399805bd39ec243ec59b78f147ce3440a8c1f9b4012969ceaa8" bitnami-pkg install mysql-client-10.1.11-0
RUN BASE_FUNCTIONS_PACKAGE_SHA256="62cd7245831ad33910523132e0f423a37d37b1b5d1ce99cb2898bfc9ee799017" bitnami-pkg install base-functions-1.0.0-1
# Install application
ENV BITNAMI_APP_NAME=redmine \
BITNAMI_APP_VERSION=3.2.0-0 \
BITNAMI_APP_USER=bitnami \
BITNAMI_APPLICATION_USER=user \
BITNAMI_APPLICATION_PASSWORD=bitnami \
IS_BITNAMI_STACK=1
BITNAMI_APP_VERSION=3.2.1-0
RUN REDMINE_PACKAGE_SHA256="59639b4a6320a7c1ddb4803c58bb3d93aa53d18e1e4deb3617c2ef8237a075f6" bitnami-pkg unpack $BITNAMI_APP_NAME-$BITNAMI_APP_VERSION
#Download latest Redmine Stack from bitnami.com
RUN $BITNAMI_PREFIX/install.sh \
--base_user $BITNAMI_APPLICATION_USER --base_password $BITNAMI_APPLICATION_PASSWORD --apache_mpm_mode event --enable_phpfpm 1 --logrotate_install 1 --disable-components subversion && \
rm $BITNAMI_PREFIX/install.sh
# Setting entry point
COPY rootfs /
ENTRYPOINT ["/app-entrypoint.sh"]
EXPOSE 80 443 22
#Using the instruction WORKDIR won't work if using volumes
ENV WORKDIR=$BITNAMI_PREFIX/apps/$BITNAMI_APP_NAME/htdocs
CMD ["harpoon", "start", "--foreground", "redmine"]

View File

@ -1,13 +1,201 @@
Copyright 2015 Bitnami
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
http://www.apache.org/licenses/LICENSE-2.0
1. Definitions.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -1,120 +1,263 @@
[![Build Status](http://bitnami-container-builds.bitnamiapp.com/jenkins/buildStatus/icon?job=docker-redmine)](http://bitnami-container-builds.bitnamiapp.com/jenkins/job/docker-redmine/)
# Bitnami Docker Image for Redmine
This is an all-in-one container for [Bitnami Redmine Stack](https://bitnami.com/stack/redmine). It includes all the required dependencies to run Redmine in a container in less than 1 minute.
# What is Redmine?
> Redmine is a flexible project management web application. Written using the Ruby on Rails framework, it is cross-platform and cross-database.
https://redmine.org/
# Prerequisites
To run this application you need Docker Engine 1.10.0. Docker Compose is recomended with a version 1.6.0 or later.
# How to use this image
## Run Redmine with a Database Container
Running Redmine with a database server is the recommended way. You can either use docker-compose or run the containers manually.
### Run the application using Docker Compose
This is the recommended way to run Redmine. You can use the following docker compose template:
# TLDR
```
docker run --name=redmine -p 80:80 -p 443:443 bitnami/redmine
```
The application is configured with default credentials `user` / `bitnami`.
version: '2'
# Get this image
services:
mariadb:
image: bitnami/mariadb:latest
volumes_from:
- mariadb_data
The recommended way to get the Bitnami Docker Image for Redmine is to pull the prebuilt image from the [Docker Hub Registry](https://hub.docker.com/r/bitnami/redmine).
mariadb_data:
image: bitnami/mariadb:latest
entrypoint: 'true'
```bash
docker pull bitnami/redmine:latest
application:
image: bitnami/redmine:latest
ports:
- 80:3000
volumes_from:
- application_data
application_data:
image: bitnami/redmine:latest
volumes:
- /bitnami/redmine
entrypoint: 'true'
```
To use a specific version, you can pull a versioned tag. You can view the
[list of available versions](https://hub.docker.com/r/bitnami/redmine/tags/)
in the Docker Hub Registry.
### Run the application manually
```bash
docker pull bitnami/redmine:[TAG]
If you want to run the application manually instead of using docker-compose, these are the basic steps you need to run:
1. Create a new network for the application and the database:
```
$ docker network create redmine_network
```
2. Start a MariaDB database in the network generated:
```
$ docker run -d --name mariadb --net=redmine_network bitnami/mariadb
```
*Note:* You need to give the container a name in order to Redmine to resolve the host
3. Run the Redmine container:
```
$ docker run -d -p 80:3000 --name redmine --net=redmine_network bitnami/redmine
```
Then you can access your application at http://your-ip/
## Persisting your application
If you remove every container all your data will be lost, and the next time you run the image the application will be reinitialized. To avoid this loss of data, you should mount a volume that will persist even after the container is removed. If you are using docker-compose your data will be persistent as long as you don't remove `mariadb_data` and `application_data` containers. Those are data volume containers (See https://docs.docker.com/engine/userguide/containers/dockervolumes/ for more information). If you have run the containers manually or you want to mount the folders with persistent data in your host follow the next steps:
> **Note!** If you have already started using your application, follow the steps on [backing](#backing-up-your-application) up to pull the data from your running container down to your host.
### Mount persistent folders in the host using docker-compose
This requires a sightly modification from the template previously shown:
```
version: '2'
services:
mariadb:
image: bitnami/mariadb:latest
volumes_from:
- mariadb_data
mariadb_data:
image: bitnami/mariadb:latest
entrypoint: 'true'
volumes:
- /your/local/path/bitnami/mariadb/data:/bitnami/mariadb/data
- /your/local/path/bitnami/mariadb/conf:/bitnami/mariadb/conf
application:
image: bitnami/redmine:latest
ports:
- 80:3000
volumes_from:
- application_data
application_data:
image: bitnami/redmine:latest
volumes:
- /bitnami/redmine
entrypoint: 'true'
mounts:
- /your/local/path/bitnami/redmine:/bitnami/redmine
```
If you wish, you can also build the image yourself.
### Mount persistent folders manually
In this case you need to specify the directories to mount on the run command. The process is the same than the one previously shown:
1. If you haven't done this before, create a new network for the application and the database:
```
$ docker network create redmine_network
```
2. Start a MariaDB database in the previous network:
```
$ docker run -d --name mariadb -v /your/local/path/bitnami/mariadb/data:/bitnami/mariadb/data -v /your/local/path/bitnami/mariadb/conf:/bitnami/mariadb/conf --network=redmine_network bitnami/mariadb
```
*Note:* You need to give the container a name in order to Redmine to resolve the host
3. Run the Redmine container:
```
$ docker run -d -p 80:3000 --name redmine -v /your/local/path/bitnami/redmine:/bitnami/redmine --network=redmine_network bitnami/redmine
```
# Upgrade this application
Bitnami provides up-to-date versions of MariaDB and Redmine, including security patches, soon after they are made upstream. We recommend that you follow these steps to upgrade your container. We will cover here the upgrade of the Redmine container. For the MariaDB upgrade see https://github.com/bitnami/bitnami-docker-mariadb/blob/master/README.md#upgrade-this-image
1. Get the updated images:
```bash
git clone https://github.com/bitnami/bitnami-docker-redmine.git
cd bitnami-docker-redmine
docker build -t bitnami/redmine .
```
$ docker pull bitnami/redmine:latest
```
2. Stop your container
* For docker-compose: `$ docker-compose stop redmine`
* For manual execution: `$ docker stop redmine`
3. (For non-compose execution only) Create a [backup](#backing-up-your-application) if you have not mounted the redmine folder in the host.
4. Remove the currently running container
* For docker-compose: `$ docker-compose rm -v redmine`
* For manual execution: `$ docker rm -v redmine`
5. Run the new image
* For docker-compose: `$ docker-compose start redmine`
* For manual execution ([mount](#mount-persistent-folders-manually) the directories if needed): `docker run --name redmine bitnami/redmine:latest`
# Configuration
## Environment variables
When you start the redmine image, you can adjust the configuration of the instance by passing one or more environment variables either on the docker-compose file or on the docker run command line. If you want to add a new environment variable:
## Application credentials
Running the container in foreground will show some information about to access your application. If you started the
container with the flag `-d` you can retrieve it by running `docker logs redmine`.
In case you want to change the default user and password for Redmine you would need to build the image by your own following [this steps](#get-this-image)
and modifying the line `BITNAMI_APPLICATION_PASSWORD=bitnami` in the Dockerfile before starting the build.
## Application files (optional)
If you want to make the application files accessible for modifying them you could use a volume to share these files with the host. This can be done by adding some extra options to the `docker run` command:
* For docker-compose add the variable name and value under the application section:
```
docker run --name=redmine -v ~/redmine-files:/opt/bitnami/apps -e USER_UID=`id -u` -p 80:80 -p 443:443 bitnami/redmine
```
This will create a folder `redmine-files` in your home directory exposing the folder `/opt/bitnami/apps` into the container. This folder should be empty or non existent when creating the container.
NOTE: Currently is only possible to expose `/opt/bitnami/apps`. Also setting the variable USER_UID will make the files modifiable by your current user.
# Logging
The Bitnami Docker Image for Redmine will write to stdout the information about the initialization process so it is accesible by running the command `docker logs redmine`.
In order to check the logs from services as the HTTP server or databases you could use the following commands:
```
docker exec -it redmine /opt/bitnami/scripts/logs.sh apache
docker exec -it redmine /opt/bitnami/scripts/logs.sh mysql
application:
image: bitnami/redmine:latest
ports:
- 80:3000
environment:
- REDMINE_PASSWORD=my_password
volumes_from:
- application_data
```
# Maintenance
## Backing up your container
In order to backup your containers you could pack the `/opt/bitnami` directory and copy it to the host by running the following commands:
* For manual execution add a `-e` option with each variable and value:
```
docker exec -it redmine /services.sh stop
docker exec -it redmine tar -pczvf /tmp/redmine-backup.tar.gz /opt/bitnami
docker exec -it redmine /services.sh start
docker cp redmine:/tmp/redmine-backup.tar.gz /path/to/destination/directory
$ docker run -d -e REDMINE_PASSWORD=my_password -p 80:3000 --name redmine -v /your/local/path/bitnami/redmine:/bitnami/redmine --network=redmine_network bitnami/redmine
```
NOTE: this commands assume that your container is named `redmine`.
## Restoring a backup
Available variables:
- `REDMINE_USERNAME`: Redmine application username. Default: **user**
- `REDMINE_PASSWORD`: Redmine application password. Default: **bitnami**
- `REDMINE_EMAIL`: Redmine application email. Default: **user@example.com**
- `REDMINE_LANG`: Redmine application default language. Default: **en**
- `MARIADB_USER`: Root user for the MariaDB database. Default: **root**
- `MARIADB_PASSWORD`: Root password for the MariaDB.
- `MARIADB_HOST`: Hostname for MariaDB server. Default: **mariadb**
- `MARIADB_PORT`: Port used by MariaDB server. Default: **3306**
In order to restore a previously created backup of your container, you woild need to copy the compressed file into the container and uncompress it by following commands:
### SMTP Configuration
To configure Redmine to send email using SMTP you can set the following environment variables:
- `SMTP_HOST`: SMTP host.
- `SMTP_PORT`: SMTP port.
- `SMTP_USER`: SMTP account user.
- `SMTP_PASSWORD`: SMTP account password.
- `SMTP_TLS`: Use TLS encription with SMTP. Default **true**
This would be an example of SMTP configuration using a GMail account:
* docker-compose:
```
docker cp /path/to/redmine-backup.tar.gz redmine:/tmp/redmine-backup.tar.gz
docker exec -it redmine /services.sh stop
docker exec -it redmine tar -xzvf /tmp/redmine-backup.tar.gz
docker exec -it redmine /services.sh start
application:
image: bitnami/redmine:latest
ports:
- 80:3000
environment:
- SMTP_HOST=smtp.gmail.com
- SMTP_PORT=587
- SMTP_USER=your_email@gmail.com
- SMTP_PASSWORD=your_password
volumes_from:
- application_data
```
NOTE: this commands assume that your container is named `redmine`.
## Upgrade this image
This image is intended for development/testing purposes. For this reason, upgrading the individual components is not supported.
# Testing
This image is tested for expected runtime behavior, using the
[Bats](https://github.com/sstephenson/bats) testing framework. You can run the tests on your machine
using the `bats` command.
* For manual execution:
```
bats test.sh
$ docker run -d -e SMTP_HOST=smtp.gmail.com -e SMTP_PORT=587 -e SMTP_USER=your_email@gmail.com -e SMTP_PASSWORD=your_password -p 80:3000 --name redmine -v /your/local/path/bitnami/redmine:/bitnami/redmine --network=redmine_network bitnami/redmine$ docker rm -v redmine
```
# Backing up your application
To backup your application data follow these steps:
1. Stop the running container:
* For docker-compose: `$ docker-compose stop redmine`
* For manual execution: `$ docker stop redmine`
2. Copy the Redmine data folder in the host:
```
$ docker cp /your/local/path/bitnami:/bitnami/redmine
```
# Restoring a backup
To restore your application using backed up data simply mount the folder with Redmine data in the container. See [persisting your application](#persisting-your-application) section for more info.
# Contributing
We'd love for you to contribute to this container. You can request new features by creating an
[issue](https://github.com/bitnami/bitnami-docker-redmine/issues), or submit a
[pull request](https://github.com/bitnami/bitnami-docker-redmine/pulls) with your contribution.
[issue](https://github.com/bitnami/redmine/issues), or submit a
[pull request](https://github.com/bitnami/redmine/pulls) with your contribution.
# Issues
If you encountered a problem running this container, you can file an
[issue](https://github.com/bitnami/bitnami-docker-redmine/issues). For us to provide better support,
[issue](https://github.com/bitnami/redmine/issues). For us to provide better support,
be sure to include the following information in your issue:
- Host OS and version

View File

@ -0,0 +1,26 @@
version: '2'
services:
mariadb:
image: bitnami/mariadb:latest
volumes_from:
- mariadb_data
mariadb_data:
image: bitnami/mariadb:latest
entrypoint: true
application:
image: bitnami/redmine:latest
ports:
- 80:3000
volumes_from:
- application_data
depends_on:
- mariadb
application_data:
image: bitnami/redmine:latest
volumes:
- /bitnami/redmine
entrypoint: true

View File

@ -0,0 +1,23 @@
#!/bin/bash
set -e
# Set default values
export REDMINE_USERNAME=${REDMINE_USERNAME:-"user"}
export REDMINE_PASSWORD=${REDMINE_PASSWORD:-"bitnami"}
export REDMINE_EMAIL=${REDMINE_EMAIL:-"user@example.com"}
export REDMINE_LANG=${REDMINE_LANG:-"en"}
export MARIADB_USER=${MARIADB_USER:-"root"}
export MARIADB_HOST=${MARIADB_HOST:-"mariadb"}
export MARIADB_PORT=${MARIADB_PORT:-"3306"}
# Package can be "installed" or "unpacked"
status=`harpoon inspect redmine`
if [[ "$status" == *'"lifecycle": "unpacked"'* && "$1" == "harpoon" && "$2" == "start" ]]; then
harpoon initialize redmine --inputs-file=/inputs.json
/entrypoint.sh
echo "Starting application..."
else
/entrypoint.sh
fi
exec tini -- "$@"

View File

@ -0,0 +1,15 @@
{
"username": "{{$global.env.REDMINE_USERNAME}}",
"password": "{{$global.env.REDMINE_PASSWORD}}",
"email": "{{$global.env.REDMINE_EMAIL}}",
"language": "{{$global.env.REDMINE_LANG}}",
"databaseAdminUser": "{{$global.env.MARIADB_USER}}",
"databaseAdminPassword": "{{$global.env.MARIADB_PASSWORD}}",
"databaseServerHost": "{{$global.env.MARIADB_HOST}}",
"databaseServerPort": "{{$global.env.MARIADB_PORT}}",
"smtpHost": "{{$global.env.SMTP_HOST}}",
"smtpPort": "{{$global.env.SMTP_PORT}}",
"smtpUser": "{{$global.env.SMTP_USER}}",
"smtpPassword": "{{$global.env.SMTP_PASSWORD}}",
"smtpTls": "{{$global.env.SMTP_TLS}}"
}

View File

@ -1,64 +0,0 @@
#!/usr/bin/env bats
BITNAMI_APP_NAME=redmine
WELCOME_PAGE_TEXT="Projects"
CONTAINER_NAME=bitnami-$BITNAMI_APP_NAME-test
IMAGE_NAME=bitnami/$BITNAMI_APP_NAME
SLEEP_TIME=90
# Check config override from host
cleanup_running_containers() {
if [ "$(docker ps -a | grep $CONTAINER_NAME)" ]; then
docker rm -fv $CONTAINER_NAME
fi
}
setup() {
cleanup_running_containers
}
teardown() {
cleanup_running_containers
}
create_container(){
docker run -d --name $CONTAINER_NAME \
--expose 80 --expose 443 $IMAGE_NAME
echo "Waiting $SLEEP_TIME for the container to initialize"
sleep $SLEEP_TIME
}
@test "We can connect to the port 80 and 443" {
create_container
docker run --link $CONTAINER_NAME:$BITNAMI_APP_NAME --rm bitnami/$BITNAMI_APP_NAME curl -L -i http://$BITNAMI_APP_NAME:80 | {
run grep "200 OK"
[ $status = 0 ]
}
docker run --link $CONTAINER_NAME:$BITNAMI_APP_NAME --rm bitnami/$BITNAMI_APP_NAME curl -L -i -k https://$BITNAMI_APP_NAME:443 | {
run grep "200 OK"
[ $status = 0 ]
}
}
@test "Returns default page" {
create_container
docker run --link $CONTAINER_NAME:$BITNAMI_APP_NAME --rm bitnami/$BITNAMI_APP_NAME curl -L -i http://$BITNAMI_APP_NAME:80 | {
run grep "$WELCOME_PAGE_TEXT"
[ $status = 0 ]
}
docker run --link $CONTAINER_NAME:$BITNAMI_APP_NAME --rm bitnami/$BITNAMI_APP_NAME curl -L -i -k https://$BITNAMI_APP_NAME:443 | {
run grep "$WELCOME_PAGE_TEXT"
[ $status = 0 ]
}
}
@test "Logs to stdout" {
create_container
docker exec $CONTAINER_NAME bash -c '$BITNAMI_PREFIX/ctlscript.sh status' | {
run grep -v "not running"
[ $status = 0 ]
}
}