From 206b0752c5e9c497c06c75e7f5afc3b8506bdb60 Mon Sep 17 00:00:00 2001 From: Bitnami Bot Date: Tue, 26 Jun 2018 09:27:13 +0000 Subject: [PATCH] 1.24.5-ol-7-r0 release Update ghost to 1.24.5 --- bitnami/ghost/1/ol-7/Dockerfile | 47 +++++++++++++++++++ bitnami/ghost/1/ol-7/docker-compose.yml | 30 ++++++++++++ bitnami/ghost/1/ol-7/rootfs/app-entrypoint.sh | 14 ++++++ bitnami/ghost/1/ol-7/rootfs/ghost-inputs.json | 18 +++++++ bitnami/ghost/1/ol-7/rootfs/init.sh | 29 ++++++++++++ .../1/ol-7/rootfs/mysql-client-inputs.json | 11 +++++ bitnami/ghost/1/ol-7/rootfs/run.sh | 18 +++++++ bitnami/ghost/README.md | 4 +- 8 files changed, 169 insertions(+), 2 deletions(-) create mode 100644 bitnami/ghost/1/ol-7/Dockerfile create mode 100644 bitnami/ghost/1/ol-7/docker-compose.yml create mode 100755 bitnami/ghost/1/ol-7/rootfs/app-entrypoint.sh create mode 100644 bitnami/ghost/1/ol-7/rootfs/ghost-inputs.json create mode 100644 bitnami/ghost/1/ol-7/rootfs/init.sh create mode 100644 bitnami/ghost/1/ol-7/rootfs/mysql-client-inputs.json create mode 100755 bitnami/ghost/1/ol-7/rootfs/run.sh diff --git a/bitnami/ghost/1/ol-7/Dockerfile b/bitnami/ghost/1/ol-7/Dockerfile new file mode 100644 index 000000000000..63cecfdf2e7b --- /dev/null +++ b/bitnami/ghost/1/ol-7/Dockerfile @@ -0,0 +1,47 @@ +FROM bitnami/oraclelinux-extras:7-r18 +LABEL maintainer "Bitnami " + +ENV BITNAMI_PKG_CHMOD="-R g+rwX,o+rw" \ + BITNAMI_PKG_EXTRA_DIRS="/.ghost /.config /.cache /opt/bitnami/content" \ + HOME="/" + +# Install required system packages and dependencies +RUN install_packages bzip2-libs glibc keyutils-libs krb5-libs libcom_err libgcc libselinux libstdc++ ncurses-libs nss-softokn-freebl openssl-libs pcre readline sqlite zlib +RUN bitnami-pkg install node-8.11.3-0 --checksum 0f9b299a5add60d28a967ab89a269a7f313f500a26b43ca825c47d878dff137d +RUN bitnami-pkg unpack mysql-client-10.1.34-0 --checksum 012f1f222898565b55f7d4522514c7c130d2bfe4c988754eed658ef6dafa980c +RUN bitnami-pkg unpack ghost-1.24.5-0 --checksum c2784b1e9afb8c2cb74b0d7bcebd641c4a103e52dba3455e00c3ff9d542159e5 + +COPY rootfs / +ENV ALLOW_EMPTY_PASSWORD="no" \ + BITNAMI_APP_NAME="ghost" \ + BITNAMI_IMAGE_VERSION="1.24.5-ol-7-r0" \ + 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_PORT_NUMBER="3306" \ + 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="" \ + SMTP_PORT="" \ + SMTP_SERVICE="" \ + SMTP_USER="" + +EXPOSE 2368 + +WORKDIR /opt/bitnami/ghost +USER 1001 +ENTRYPOINT ["/app-entrypoint.sh"] +CMD ["/run.sh"] diff --git a/bitnami/ghost/1/ol-7/docker-compose.yml b/bitnami/ghost/1/ol-7/docker-compose.yml new file mode 100644 index 000000000000..ceda25aeea64 --- /dev/null +++ b/bitnami/ghost/1/ol-7/docker-compose.yml @@ -0,0 +1,30 @@ +version: '2' +services: + mariadb: + image: 'bitnami/mariadb:10.1-ol-7' + environment: + - ALLOW_EMPTY_PASSWORD=yes + - MARIADB_USER=bn_ghost + - MARIADB_DATABASE=bitnami_ghost + volumes: + - 'mariadb_data:/bitnami' + ghost: + image: 'bitnami/ghost:1-ol-7' + 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 +volumes: + mariadb_data: + driver: local + ghost_data: + driver: local diff --git a/bitnami/ghost/1/ol-7/rootfs/app-entrypoint.sh b/bitnami/ghost/1/ol-7/rootfs/app-entrypoint.sh new file mode 100755 index 000000000000..d91b4d453843 --- /dev/null +++ b/bitnami/ghost/1/ol-7/rootfs/app-entrypoint.sh @@ -0,0 +1,14 @@ +#!/bin/bash -e + +. /opt/bitnami/base/functions +. /opt/bitnami/base/helpers + +print_welcome_page + +if [[ "$1" == "nami" && "$2" == "start" ]] || [[ "$1" == "/run.sh" ]]; then + . /init.sh + nami_initialize mysql-client ghost + info "Starting ghost... " +fi + +exec tini -- "$@" diff --git a/bitnami/ghost/1/ol-7/rootfs/ghost-inputs.json b/bitnami/ghost/1/ol-7/rootfs/ghost-inputs.json new file mode 100644 index 000000000000..305c34969071 --- /dev/null +++ b/bitnami/ghost/1/ol-7/rootfs/ghost-inputs.json @@ -0,0 +1,18 @@ +{ + "blogTitle": "{{$global.env.BLOG_TITLE}}", + "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}}", + "port": "{{$global.env.GHOST_PORT_NUMBER}}", + "smtpHost": "{{$global.env.SMTP_HOST}}", + "smtpPassword": "{{$global.env.SMTP_PASSWORD}}", + "smtpPort": "{{$global.env.SMTP_PORT}}", + "smtpService": "{{$global.env.SMTP_SERVICE}}", + "smtpUser": "{{$global.env.SMTP_USER}}", + "username": "{{$global.env.GHOST_USERNAME}}" +} \ No newline at end of file diff --git a/bitnami/ghost/1/ol-7/rootfs/init.sh b/bitnami/ghost/1/ol-7/rootfs/init.sh new file mode 100644 index 000000000000..cdd15296bc6c --- /dev/null +++ b/bitnami/ghost/1/ol-7/rootfs/init.sh @@ -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 diff --git a/bitnami/ghost/1/ol-7/rootfs/mysql-client-inputs.json b/bitnami/ghost/1/ol-7/rootfs/mysql-client-inputs.json new file mode 100644 index 000000000000..6a20ec0837a0 --- /dev/null +++ b/bitnami/ghost/1/ol-7/rootfs/mysql-client-inputs.json @@ -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}}" +} \ No newline at end of file diff --git a/bitnami/ghost/1/ol-7/rootfs/run.sh b/bitnami/ghost/1/ol-7/rootfs/run.sh new file mode 100755 index 000000000000..03408f4edc0d --- /dev/null +++ b/bitnami/ghost/1/ol-7/rootfs/run.sh @@ -0,0 +1,18 @@ +#!/bin/bash +. /opt/bitnami/base/functions +. /opt/bitnami/base/helpers + +USER=ghost + +# The reason to use the pipe is that currently there is no way to start ghost in unattended mode +# as it will ask you to update ghost-cli or continue without doing it: +# https://github.com/TryGhost/Ghost-CLI/issues/563 +START_COMMAND="echo y | ghost start && tail -f /opt/bitnami/ghost/logs/ghost.log" +export NODE_ENV=production + +# If container is started as `root` user +if [ $EUID -eq 0 ]; then + exec gosu ${USER} bash -c "${START_COMMAND}" +else + exec bash -c "$START_COMMAND" +fi diff --git a/bitnami/ghost/README.md b/bitnami/ghost/README.md index a201f110eeae..06846a96aaa6 100644 --- a/bitnami/ghost/README.md +++ b/bitnami/ghost/README.md @@ -26,7 +26,7 @@ $ docker-compose up -d # Supported tags and respective `Dockerfile` links * [`1`, `1.24.5-r6`, `latest` (1/Dockerfile)](https://github.com/bitnami/bitnami-docker-ghost/blob/1.24.5-r6/1/Dockerfile) -* [`1-ol-7`, `1.03.1-ol-7-r0` (1/ol-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-ghost/blob/1.03.1-ol-7-r0/1/ol-7/Dockerfile) +* [`1-ol-7`, `1.24.5-ol-7-r0` (1/ol-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-ghost/blob/1.24.5-ol-7-r0/1/ol-7/Dockerfile) Subscribe to project updates by watching the [bitnami/codiad GitHub repo](https://github.com/bitnami/bitnami-docker-ghost). @@ -37,7 +37,7 @@ To run this application you need Docker Engine 1.10.0. Docker Compose is recomen # Supported tags and respective `Dockerfile` links * [`1`, `1.24.5-r6`, `latest` (1/Dockerfile)](https://github.com/bitnami/bitnami-docker-ghost/blob/1.24.5-r6/1/Dockerfile) -* [`1-ol-7`, `1.03.1-ol-7-r0` (1/ol-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-ghost/blob/1.03.1-ol-7-r0/1/ol-7/Dockerfile) +* [`1-ol-7`, `1.24.5-ol-7-r0` (1/ol-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-ghost/blob/1.24.5-ol-7-r0/1/ol-7/Dockerfile) Subscribe to project updates by watching the [bitnami/ghost GitHub repo](https://github.com/bitnami/bitnami-docker-ghost).