1.17.3-r1 release

Ghost expects an existing database to be configured with.
This commit is contained in:
Bitnami Bot
2017-11-21 15:10:19 +00:00
parent 51ecdbac0a
commit 029f6530b6
8 changed files with 151 additions and 37 deletions

View File

@@ -8,23 +8,31 @@ ENV BITNAMI_PKG_CHMOD="-R g+rwX" \
# Install required system packages and dependencies
RUN install_packages ghostscript imagemagick libbz2-1.0 libc6 libgcc1 libmysqlclient18 libncurses5 libreadline6 libsqlite3-0 libssl1.0.0 libstdc++6 libtinfo5 zlib1g
RUN bitnami-pkg install node-6.12.0-0 --checksum 40f925d35c877a20526039b908fc1adea4fb7dfae83634860c1e88bde5d751de
RUN bitnami-pkg install mysql-client-10.1.29-0 --checksum 4b29436697f5fcdf38f3c9713a27208304fe36b858afc5aa5a7a4d3f17d84bac
RUN bitnami-pkg unpack ghost-1.17.3-0 --checksum 96d66d899defc0561fb9dec9dcd4ff6c0529d131bd57bc0bbbfb19f4bb7cc926
RUN bitnami-pkg unpack mysql-client-10.1.29-0 --checksum 4b29436697f5fcdf38f3c9713a27208304fe36b858afc5aa5a7a4d3f17d84bac
RUN bitnami-pkg unpack ghost-1.17.3-1 --checksum 186e8b042119be399176240d36790c51f04bc7d02154c76b189259b4cabe82ae
COPY rootfs /
ENV BITNAMI_APP_NAME="ghost" \
BITNAMI_IMAGE_VERSION="1.17.3-r0" \
ENV ALLOW_EMPTY_PASSWORD="no" \
BITNAMI_APP_NAME="ghost" \
BITNAMI_IMAGE_VERSION="1.17.3-r1" \
BLOG_TITLE="User's Blog" \
GHOST_DATABASE_NAME="bitnami_ghost" \
GHOST_DATABASE_PASSWORD="" \
GHOST_DATABASE_USER="bn_ghost" \
GHOST_EMAIL="user@example.com" \
GHOST_HOST="" \
GHOST_PASSWORD="bitnami123" \
GHOST_PORT_NUMBER="" \
GHOST_USERNAME="user" \
MARIADB_HOST="mariadb" \
MARIADB_PASSWORD="" \
MARIADB_PORT_NUMBER="3306" \
MARIADB_USER="root" \
MARIADB_ROOT_PASSWORD="" \
MARIADB_ROOT_USER="root" \
MYSQL_CLIENT_CREATE_DATABASE_NAME="" \
MYSQL_CLIENT_CREATE_DATABASE_PASSWORD="" \
MYSQL_CLIENT_CREATE_DATABASE_PRIVILEGES="ALL" \
MYSQL_CLIENT_CREATE_DATABASE_USER="" \
PATH="/opt/bitnami/node/bin:/opt/bitnami/mysql/bin:/opt/bitnami/ghost/bin:$PATH" \
SMTP_HOST="" \
SMTP_PASSWORD="" \

View File

@@ -4,20 +4,27 @@ services:
image: 'bitnami/mariadb:latest'
environment:
- ALLOW_EMPTY_PASSWORD=yes
- MARIADB_USER=bn_ghost
- MARIADB_DATABASE=bitnami_ghost
volumes:
- 'mariadb_data:/bitnami'
ghost:
image: 'bitnami/ghost:1'
labels:
kompose.service.type: nodeport
environment:
- MARIADB_HOST=mariadb
- MARIADB_PORT_NUMBER=3306
- GHOST_DATABASE_USER=bn_ghost
- GHOST_DATABASE_NAME=bitnami_ghost
- ALLOW_EMPTY_PASSWORD=yes
- GHOST_HOST=localhost
ports:
- '80:2368'
volumes:
- 'ghost_data:/bitnami'
depends_on:
- mariadb
environment:
- GHOST_HOST=localhost
volumes:
mariadb_data:
driver: local

View File

@@ -6,7 +6,8 @@
print_welcome_page
if [[ "$1" == "nami" && "$2" == "start" ]] || [[ "$1" == "/run.sh" ]]; then
nami_initialize ghost
. /init.sh
nami_initialize mysql-client ghost
info "Starting ghost... "
fi

View File

@@ -1,9 +1,10 @@
{
"blogTitle": "{{$global.env.BLOG_TITLE}}",
"databaseAdminPassword": "{{$global.env.MARIADB_PASSWORD}}",
"databaseAdminUser": "{{$global.env.MARIADB_USER}}",
"databaseName": "{{$global.env.GHOST_DATABASE_NAME}}",
"databasePassword": "{{$global.env.GHOST_DATABASE_PASSWORD}}",
"databaseServerHost": "{{$global.env.MARIADB_HOST}}",
"databaseServerPort": "{{$global.env.MARIADB_PORT_NUMBER}}",
"databaseUser": "{{$global.env.GHOST_DATABASE_USER}}",
"email": "{{$global.env.GHOST_EMAIL}}",
"host": "{{$global.env.GHOST_HOST}}",
"password": "{{$global.env.GHOST_PASSWORD}}",

View File

@@ -0,0 +1,29 @@
##
## @brief Helper function to show an error when a password is empty and exit
## param $1 Input name
##
empty_password_error() {
error "The $1 environment variable is empty or not set. Set the environment variable ALLOW_EMPTY_PASSWORD=yes to allow the container to be started with blank passwords. This is recommended only for development."
exit 1
}
##
## @brief Helper function to show a warning when the ALLOW_EMPTY_PASSWORD flag is enabled
##
empty_password_enabled_warn() {
warn "You set the environment variable ALLOW_EMPTY_PASSWORD=${ALLOW_EMPTY_PASSWORD}. For safety reasons, do not use this flag in a production environment."
}
# Validate passwords
if [[ "$ALLOW_EMPTY_PASSWORD" =~ ^(yes|Yes|YES)$ ]]; then
empty_password_enabled_warn
else
# Database creation by MySQL client
if [[ -n "$MYSQL_CLIENT_CREATE_DATABASE_USER" && -z "$MYSQL_CLIENT_CREATE_DATABASE_PASSWORD" ]]; then
empty_password_error MYSQL_CLIENT_CREATE_DATABASE_PASSWORD
fi
# Ghost database
if [[ -z "$GHOST_DATABASE_PASSWORD" ]]; then
empty_password_error GHOST_DATABASE_PASSWORD
fi
fi

View File

@@ -0,0 +1,11 @@
{
"allowEmptyPassword": "{{$global.env.ALLOW_EMPTY_PASSWORD}}",
"createDatabaseName": "{{$global.env.MYSQL_CLIENT_CREATE_DATABASE_NAME}}",
"createDatabasePassword": "{{$global.env.MYSQL_CLIENT_CREATE_DATABASE_PASSWORD}}",
"createDatabasePrivileges": "{{$global.env.MYSQL_CLIENT_CREATE_DATABASE_PRIVILEGES}}",
"createDatabaseUser": "{{$global.env.MYSQL_CLIENT_CREATE_DATABASE_USER}}",
"host": "{{$global.env.MARIADB_HOST}}",
"port": "{{$global.env.MARIADB_PORT_NUMBER}}",
"rootPassword": "{{$global.env.MARIADB_ROOT_PASSWORD}}",
"rootUser": "{{$global.env.MARIADB_ROOT_USER}}"
}

View File

@@ -52,20 +52,27 @@ services:
image: 'bitnami/mariadb:latest'
environment:
- ALLOW_EMPTY_PASSWORD=yes
- MARIADB_USER=bn_ghost
- MARIADB_DATABASE=bitnami_ghost
volumes:
- 'mariadb_data:/bitnami'
ghost:
image: 'bitnami/ghost:latest'
image: 'bitnami/ghost:1'
labels:
kompose.service.type: nodeport
environment:
- MARIADB_HOST=mariadb
- MARIADB_PORT_NUMBER=3306
- GHOST_DATABASE_USER=bn_ghost
- GHOST_DATABASE_NAME=bitnami_ghost
- ALLOW_EMPTY_PASSWORD=yes
- GHOST_HOST=localhost
ports:
- '80:2368'
volumes:
- 'ghost_data:/bitnami'
depends_on:
- mariadb
environment:
- GHOST_HOST=localhost
volumes:
mariadb_data:
driver: local
@@ -83,23 +90,35 @@ If you want to run the application manually instead of using docker-compose, the
$ docker network create ghost-tier
```
2. Start a MariaDB database in the network generated:
2. Create a volume for MariaDB persistence and create a MariaDB container
```bash
$ docker run -d --name mariadb --net=ghost-tier \
-e ALLOW_EMPTY_PASSWORD=yes \
bitnami/mariadb
```
```bash
$ docker volume create --name mariadb_data
$ docker run -d --name mariadb \
-e ALLOW_EMPTY_PASSWORD=yes \
-e MARIADB_USER=bn_ghost \
-e MARIADB_DATABASE=bitnami_ghost \
--net ghost-tier \
--volume mariadb_data:/bitnami \
bitnami/mariadb:latest
```
*Note:* You need to give the container a name in order to Ghost to resolve the host
3. Run the Ghost container:
3. Create volumes for Ghost persistence and launch the container
```bash
$ docker run -d -p 80:2368 --name ghost --net=ghost-tier bitnami/ghost
$ docker volume create --name ghost_data
$ docker run -d --name ghost -p 80:80 -p 443:443 \
-e ALLOW_EMPTY_PASSWORD=yes \
-e GHOST_DATABASE_USER=bn_ghost \
-e GHOST_DATABASE_NAME=bitnami_ghost \
--net ghost-tier \
--volume ghost_data:/bitnami \
bitnami/ghost:latest
```
Then you can access your application at http://your-ip/
Access your application at http://your-ip/
> **Note!** If you want to access your application from a public IP or hostname you need to properly configured Ghost . You can handle it adjusting the configuration of the instance by setting the environment variable `GHOST_HOST` to your public IP or hostname.
@@ -125,6 +144,8 @@ services:
image: 'bitnami/mariadb:latest'
environment:
- ALLOW_EMPTY_PASSWORD=yes
- MARIADB_USER=bn_ghost
- MARIADB_DATABASE=bitnami_ghost
volumes:
- /path/to/mariadb-persistence:/bitnami
ghost:
@@ -133,6 +154,11 @@ services:
- mariadb
ports:
- '80:2368'
environment:
- ALLOW_EMPTY_PASSWORD=yes
- GHOST_DATABASE_USER=bn_ghost
- GHOST_DATABASE_NAME=bitnami_ghost
- GHOST_HOST=localhost
volumes:
- '/path/to/ghost-persistence:/bitnami'
```
@@ -152,6 +178,8 @@ In this case you need to specify the directories to mount on the run command. Th
```bash
$ docker run -d --name mariadb --net ghost-tier \
-e ALLOW_EMPTY_PASSWORD=yes \
-e MARIADB_USER=bn_ghost \
-e MARIADB_DATABASE=bitnami_ghost \
--volume /path/to/mariadb-persistence:/bitnami \
bitnami/mariadb:latest
```
@@ -161,7 +189,12 @@ In this case you need to specify the directories to mount on the run command. Th
3. Create the Ghost container with host volumes:
```bash
$ docker run -d --name ghost -p 80:2368 --net ghost-tier \
$ docker run -d --name ghost -p 80:2368 \
-e ALLOW_EMPTY_PASSWORD=yes \
-e GHOST_DATABASE_USER=bn_ghost \
-e GHOST_DATABASE_NAME=bitnami_ghost \
-e GHOST_HOST=localhost \
--net ghost-tier \
--volume /path/to/ghost-persistence:/bitnami \
bitnami/ghost:latest
```
@@ -228,18 +261,36 @@ ghost:
```
Available variables:
- `GHOST_HOST`: Hostname for Ghost.
- `GHOST_PORT_NUMBER`: Port number used in the generated application URLs. Default: **80**
- `GHOST_USERNAME`: Ghost application username. Default: **user**
- `GHOST_PASSWORD`: Ghost application password. Minimum length is 10 characters. Default: **bitnami123**
- `GHOST_EMAIL`: Ghost application email. Default: **user@example.com**
- `BLOG_TITLE`: Ghost blog title. Default: **User's Blog**
- `MARIADB_USER`: Root user for the MariaDB database. By default: root.
- `MARIADB_PASSWORD`: Root password for the MariaDB database.
- `MARIADB_HOST`: Hostname for MariaDB server. Default: **mariadb**
- `MARIADB_PORT_NUMBER`: Port used by MariaDB server. Default: **3306**
### SMTP Configuration
##### User and Site configuration
- `GHOST_HOST`: Hostname for Ghost.
- `GHOST_PORT_NUMBER`: Port number used in the generated application URLs. Default: **80**
- `GHOST_USERNAME`: Ghost application username. Default: **user**
- `GHOST_PASSWORD`: Ghost application password. Minimum length is 10 characters. Default: **bitnami123**
- `GHOST_EMAIL`: Ghost application email. Default: **user@example.com**
- `BLOG_TITLE`: Ghost blog title. Default: **User's Blog**
##### Use an existing database
- `MARIADB_HOST`: Hostname for MariaDB server. Default: **mariadb**
- `MARIADB_PORT_NUMBER`: Port used by MariaDB server. Default: **3306**
- `GHOST_DATABASE_NAME`: Database name that Ghost will use to connect with the database. Default: **bitnami_ghost**
- `GHOST_DATABASE_USER`: Database user that Ghost will use to connect with the database. Default: **bn_ghost**
- `GHOST_DATABASE_PASSWORD`: Database password that Ghost will use to connect with the database. No defaults.
- `ALLOW_EMPTY_PASSWORD`: It can be used to allow blank passwords. Default: **no**
##### Create a database for Ghost using mysql-client
- `MARIADB_HOST`: Hostname for MariaDB server. Default: **mariadb**
- `MARIADB_PORT_NUMBER`: Port used by MariaDB server. Default: **3306**
- `MARIADB_ROOT_USER`: Database admin user. Default: **root**
- `MARIADB_ROOT_PASSWORD`: Database password for the `MARIADB_ROOT_USER` user. No defaults.
- `MYSQL_CLIENT_CREATE_DATABASE_NAME`: New database to be created by the mysql client module. No defaults.
- `MYSQL_CLIENT_CREATE_DATABASE_USER`: New database user to be created by the mysql client module. No defaults.
- `MYSQL_CLIENT_CREATE_DATABASE_PASSWORD`: Database password for the `MYSQL_CLIENT_CREATE_DATABASE_USER` user. No defaults.
- `ALLOW_EMPTY_PASSWORD`: It can be used to allow blank passwords. Default: **no**
##### SMTP Configuration
To configure Ghost to send email using SMTP you can set the following environment variables:
- `SMTP_HOST`: SMTP host.
@@ -258,6 +309,10 @@ This would be an example of SMTP configuration using a GMail account:
ports:
- 80:2368
environment:
- GHOST_HOST=localhost
- ALLOW_EMPTY_PASSWORD=yes
- GHOST_DATABASE_USER=bn_ghost
- GHOST_DATABASE_NAME=bitnami_ghost
- SMTP_HOST=smtp.gmail.com
- SMTP_USER=your_email@gmail.com
- SMTP_PASSWORD=your_password
@@ -268,6 +323,10 @@ This would be an example of SMTP configuration using a GMail account:
```bash
$ docker run -d -p 80:2368 --name ghost --network=ghost-tier \
-e GHOST_HOST=localhost \
-e ALLOW_EMPTY_PASSWORD=yes \
-e GHOST_DATABASE_USER=bn_ghost \
-e GHOST_DATABASE_NAME=bitnami_ghost \
-e SMTP_HOST=smtp.gmail.com \
-e SMTP_SERVICE=GMail \
-e SMTP_USER=your_email@gmail.com \

View File

@@ -8,8 +8,6 @@ jobs:
RELEASE_SERIES_LIST: "1"
LATEST_STABLE: "1"
IMAGE_NAME: ghost
CHART_NAME: ghost
CHART_REPO: https://github.com/kubernetes/charts
DOCKER_PROJECT: bitnami
QUAY_PROJECT: bitnami
GCLOUD_PROJECT: bitnami-containers