diff --git a/0.54/18-alpine3.18/Dockerfile b/0.54/18-alpine3.18/Dockerfile new file mode 100644 index 0000000..0be2fb5 --- /dev/null +++ b/0.54/18-alpine3.18/Dockerfile @@ -0,0 +1,44 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +# https://nodejs.org/en/about/releases/ +# https://github.com/nodejs/Release#readme +FROM node:18-alpine3.18 + +RUN set -eux; \ + apk add --no-cache \ + bash \ + # grab tini for signal processing and zombie killing + tini + +WORKDIR /app + +ARG MONGO_EXPRESS_REPOSITORY=mongo-express/mongo-express +ARG MONGO_EXPRESS_VERSION=release/v0.54.0 + +RUN set -eux; \ + apk add --no-cache --virtual .me-fetch-deps git; \ + git clone --depth 1 --branch "$MONGO_EXPRESS_VERSION" -c advice.detachedHead=false https://github.com/$MONGO_EXPRESS_REPOSITORY.git .; \ + export DISABLE_V8_COMPILE_CACHE=1; \ + yarn install; \ + yarn build; \ + yarn remove --all; \ + yarn workspaces focus --production; \ + yarn cache clean; \ + apk del --no-network .me-fetch-deps; \ + rm -rf .git* ~/.cache ~/.yarn + +# override some config defaults with values that will work better for docker +ENV ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" \ + ME_CONFIG_MONGODB_ENABLE_ADMIN="true" \ + ME_CONFIG_SITE_SESSIONSECRET="secret" \ + ME_CONFIG_BASICAUTH=true \ + VCAP_APP_HOST="0.0.0.0" + +EXPOSE 8081 +COPY docker-entrypoint.sh / +ENTRYPOINT [ "/sbin/tini", "--", "/docker-entrypoint.sh"] +CMD ["mongo-express"] diff --git a/0.54/18-alpine3.18/docker-entrypoint.sh b/0.54/18-alpine3.18/docker-entrypoint.sh new file mode 100755 index 0000000..df53c12 --- /dev/null +++ b/0.54/18-alpine3.18/docker-entrypoint.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# This file is auto-generated. Do not edit directly! +set -eo pipefail + +# if command does not start with mongo-express, run the command instead of the entrypoint +if [ "${1}" != "mongo-express" ]; then + exec "$@" +fi + +function wait_tcp_port { + local host="$1" port="$2" + local max_tries="$3" tries=1 + + # see http://tldp.org/LDP/abs/html/devref1.html for description of this syntax. + while ! exec 6<>/dev/tcp/$host/$port && [[ $tries -lt $max_tries ]]; do + sleep 1s + tries=$(( tries + 1 )) + echo "$(date) retrying to connect to $host:$port ($tries/$max_tries)" + done + exec 6>&- +} + +# if ME_CONFIG_MONGODB_URL has a comma in it, we're pointing to a replica set (https://github.com/mongo-express/mongo-express-docker/issues/21) +if [[ "$ME_CONFIG_MONGODB_URL" != *,* ]]; then + work=$ME_CONFIG_MONGODB_URL + # Remove the scheme (should be "mongodb://" or "mongodb+srv://"). + work=${work#*://} + # Remove the path component of the URL (should just be a "/"). + work=${work%%/*} + # Remove the userinfo. + work=${work#*@} + if [[ "$work" = *:* ]]; then + # Match the host. + host=${work%:*} + # Match the port. + port=${work#*:} + else + host=$work + port=27017 + fi + + # wait for the mongo server to be available + echo "Waiting for $host:$port..." + wait_tcp_port "$host" "$port" "${ME_CONFIG_CONNECT_RETRIES:-10}" +fi + +# run mongo-express +exec node app diff --git a/0.54/18-alpine3.19/Dockerfile b/0.54/18-alpine3.19/Dockerfile new file mode 100644 index 0000000..d4443ec --- /dev/null +++ b/0.54/18-alpine3.19/Dockerfile @@ -0,0 +1,44 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +# https://nodejs.org/en/about/releases/ +# https://github.com/nodejs/Release#readme +FROM node:18-alpine3.19 + +RUN set -eux; \ + apk add --no-cache \ + bash \ + # grab tini for signal processing and zombie killing + tini + +WORKDIR /app + +ARG MONGO_EXPRESS_REPOSITORY=mongo-express/mongo-express +ARG MONGO_EXPRESS_VERSION=release/v0.54.0 + +RUN set -eux; \ + apk add --no-cache --virtual .me-fetch-deps git; \ + git clone --depth 1 --branch "$MONGO_EXPRESS_VERSION" -c advice.detachedHead=false https://github.com/$MONGO_EXPRESS_REPOSITORY.git .; \ + export DISABLE_V8_COMPILE_CACHE=1; \ + yarn install; \ + yarn build; \ + yarn remove --all; \ + yarn workspaces focus --production; \ + yarn cache clean; \ + apk del --no-network .me-fetch-deps; \ + rm -rf .git* ~/.cache ~/.yarn + +# override some config defaults with values that will work better for docker +ENV ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" \ + ME_CONFIG_MONGODB_ENABLE_ADMIN="true" \ + ME_CONFIG_SITE_SESSIONSECRET="secret" \ + ME_CONFIG_BASICAUTH=true \ + VCAP_APP_HOST="0.0.0.0" + +EXPOSE 8081 +COPY docker-entrypoint.sh / +ENTRYPOINT [ "/sbin/tini", "--", "/docker-entrypoint.sh"] +CMD ["mongo-express"] diff --git a/0.54/18-alpine3.19/docker-entrypoint.sh b/0.54/18-alpine3.19/docker-entrypoint.sh new file mode 100755 index 0000000..df53c12 --- /dev/null +++ b/0.54/18-alpine3.19/docker-entrypoint.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# This file is auto-generated. Do not edit directly! +set -eo pipefail + +# if command does not start with mongo-express, run the command instead of the entrypoint +if [ "${1}" != "mongo-express" ]; then + exec "$@" +fi + +function wait_tcp_port { + local host="$1" port="$2" + local max_tries="$3" tries=1 + + # see http://tldp.org/LDP/abs/html/devref1.html for description of this syntax. + while ! exec 6<>/dev/tcp/$host/$port && [[ $tries -lt $max_tries ]]; do + sleep 1s + tries=$(( tries + 1 )) + echo "$(date) retrying to connect to $host:$port ($tries/$max_tries)" + done + exec 6>&- +} + +# if ME_CONFIG_MONGODB_URL has a comma in it, we're pointing to a replica set (https://github.com/mongo-express/mongo-express-docker/issues/21) +if [[ "$ME_CONFIG_MONGODB_URL" != *,* ]]; then + work=$ME_CONFIG_MONGODB_URL + # Remove the scheme (should be "mongodb://" or "mongodb+srv://"). + work=${work#*://} + # Remove the path component of the URL (should just be a "/"). + work=${work%%/*} + # Remove the userinfo. + work=${work#*@} + if [[ "$work" = *:* ]]; then + # Match the host. + host=${work%:*} + # Match the port. + port=${work#*:} + else + host=$work + port=27017 + fi + + # wait for the mongo server to be available + echo "Waiting for $host:$port..." + wait_tcp_port "$host" "$port" "${ME_CONFIG_CONNECT_RETRIES:-10}" +fi + +# run mongo-express +exec node app diff --git a/0.54/18-alpine3.20/Dockerfile b/0.54/18-alpine3.20/Dockerfile new file mode 100644 index 0000000..065609a --- /dev/null +++ b/0.54/18-alpine3.20/Dockerfile @@ -0,0 +1,44 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +# https://nodejs.org/en/about/releases/ +# https://github.com/nodejs/Release#readme +FROM node:18-alpine3.20 + +RUN set -eux; \ + apk add --no-cache \ + bash \ + # grab tini for signal processing and zombie killing + tini + +WORKDIR /app + +ARG MONGO_EXPRESS_REPOSITORY=mongo-express/mongo-express +ARG MONGO_EXPRESS_VERSION=release/v0.54.0 + +RUN set -eux; \ + apk add --no-cache --virtual .me-fetch-deps git; \ + git clone --depth 1 --branch "$MONGO_EXPRESS_VERSION" -c advice.detachedHead=false https://github.com/$MONGO_EXPRESS_REPOSITORY.git .; \ + export DISABLE_V8_COMPILE_CACHE=1; \ + yarn install; \ + yarn build; \ + yarn remove --all; \ + yarn workspaces focus --production; \ + yarn cache clean; \ + apk del --no-network .me-fetch-deps; \ + rm -rf .git* ~/.cache ~/.yarn + +# override some config defaults with values that will work better for docker +ENV ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" \ + ME_CONFIG_MONGODB_ENABLE_ADMIN="true" \ + ME_CONFIG_SITE_SESSIONSECRET="secret" \ + ME_CONFIG_BASICAUTH=true \ + VCAP_APP_HOST="0.0.0.0" + +EXPOSE 8081 +COPY docker-entrypoint.sh / +ENTRYPOINT [ "/sbin/tini", "--", "/docker-entrypoint.sh"] +CMD ["mongo-express"] diff --git a/0.54/18-alpine3.20/docker-entrypoint.sh b/0.54/18-alpine3.20/docker-entrypoint.sh new file mode 100755 index 0000000..df53c12 --- /dev/null +++ b/0.54/18-alpine3.20/docker-entrypoint.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# This file is auto-generated. Do not edit directly! +set -eo pipefail + +# if command does not start with mongo-express, run the command instead of the entrypoint +if [ "${1}" != "mongo-express" ]; then + exec "$@" +fi + +function wait_tcp_port { + local host="$1" port="$2" + local max_tries="$3" tries=1 + + # see http://tldp.org/LDP/abs/html/devref1.html for description of this syntax. + while ! exec 6<>/dev/tcp/$host/$port && [[ $tries -lt $max_tries ]]; do + sleep 1s + tries=$(( tries + 1 )) + echo "$(date) retrying to connect to $host:$port ($tries/$max_tries)" + done + exec 6>&- +} + +# if ME_CONFIG_MONGODB_URL has a comma in it, we're pointing to a replica set (https://github.com/mongo-express/mongo-express-docker/issues/21) +if [[ "$ME_CONFIG_MONGODB_URL" != *,* ]]; then + work=$ME_CONFIG_MONGODB_URL + # Remove the scheme (should be "mongodb://" or "mongodb+srv://"). + work=${work#*://} + # Remove the path component of the URL (should just be a "/"). + work=${work%%/*} + # Remove the userinfo. + work=${work#*@} + if [[ "$work" = *:* ]]; then + # Match the host. + host=${work%:*} + # Match the port. + port=${work#*:} + else + host=$work + port=27017 + fi + + # wait for the mongo server to be available + echo "Waiting for $host:$port..." + wait_tcp_port "$host" "$port" "${ME_CONFIG_CONNECT_RETRIES:-10}" +fi + +# run mongo-express +exec node app diff --git a/0.54/20-alpine3.18/Dockerfile b/0.54/20-alpine3.18/Dockerfile new file mode 100644 index 0000000..65e6925 --- /dev/null +++ b/0.54/20-alpine3.18/Dockerfile @@ -0,0 +1,44 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +# https://nodejs.org/en/about/releases/ +# https://github.com/nodejs/Release#readme +FROM node:20-alpine3.18 + +RUN set -eux; \ + apk add --no-cache \ + bash \ + # grab tini for signal processing and zombie killing + tini + +WORKDIR /app + +ARG MONGO_EXPRESS_REPOSITORY=mongo-express/mongo-express +ARG MONGO_EXPRESS_VERSION=release/v0.54.0 + +RUN set -eux; \ + apk add --no-cache --virtual .me-fetch-deps git; \ + git clone --depth 1 --branch "$MONGO_EXPRESS_VERSION" -c advice.detachedHead=false https://github.com/$MONGO_EXPRESS_REPOSITORY.git .; \ + export DISABLE_V8_COMPILE_CACHE=1; \ + yarn install; \ + yarn build; \ + yarn remove --all; \ + yarn workspaces focus --production; \ + yarn cache clean; \ + apk del --no-network .me-fetch-deps; \ + rm -rf .git* ~/.cache ~/.yarn + +# override some config defaults with values that will work better for docker +ENV ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" \ + ME_CONFIG_MONGODB_ENABLE_ADMIN="true" \ + ME_CONFIG_SITE_SESSIONSECRET="secret" \ + ME_CONFIG_BASICAUTH=true \ + VCAP_APP_HOST="0.0.0.0" + +EXPOSE 8081 +COPY docker-entrypoint.sh / +ENTRYPOINT [ "/sbin/tini", "--", "/docker-entrypoint.sh"] +CMD ["mongo-express"] diff --git a/0.54/20-alpine3.18/docker-entrypoint.sh b/0.54/20-alpine3.18/docker-entrypoint.sh new file mode 100755 index 0000000..df53c12 --- /dev/null +++ b/0.54/20-alpine3.18/docker-entrypoint.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# This file is auto-generated. Do not edit directly! +set -eo pipefail + +# if command does not start with mongo-express, run the command instead of the entrypoint +if [ "${1}" != "mongo-express" ]; then + exec "$@" +fi + +function wait_tcp_port { + local host="$1" port="$2" + local max_tries="$3" tries=1 + + # see http://tldp.org/LDP/abs/html/devref1.html for description of this syntax. + while ! exec 6<>/dev/tcp/$host/$port && [[ $tries -lt $max_tries ]]; do + sleep 1s + tries=$(( tries + 1 )) + echo "$(date) retrying to connect to $host:$port ($tries/$max_tries)" + done + exec 6>&- +} + +# if ME_CONFIG_MONGODB_URL has a comma in it, we're pointing to a replica set (https://github.com/mongo-express/mongo-express-docker/issues/21) +if [[ "$ME_CONFIG_MONGODB_URL" != *,* ]]; then + work=$ME_CONFIG_MONGODB_URL + # Remove the scheme (should be "mongodb://" or "mongodb+srv://"). + work=${work#*://} + # Remove the path component of the URL (should just be a "/"). + work=${work%%/*} + # Remove the userinfo. + work=${work#*@} + if [[ "$work" = *:* ]]; then + # Match the host. + host=${work%:*} + # Match the port. + port=${work#*:} + else + host=$work + port=27017 + fi + + # wait for the mongo server to be available + echo "Waiting for $host:$port..." + wait_tcp_port "$host" "$port" "${ME_CONFIG_CONNECT_RETRIES:-10}" +fi + +# run mongo-express +exec node app diff --git a/0.54/20-alpine3.19/Dockerfile b/0.54/20-alpine3.19/Dockerfile new file mode 100644 index 0000000..6a84201 --- /dev/null +++ b/0.54/20-alpine3.19/Dockerfile @@ -0,0 +1,44 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +# https://nodejs.org/en/about/releases/ +# https://github.com/nodejs/Release#readme +FROM node:20-alpine3.19 + +RUN set -eux; \ + apk add --no-cache \ + bash \ + # grab tini for signal processing and zombie killing + tini + +WORKDIR /app + +ARG MONGO_EXPRESS_REPOSITORY=mongo-express/mongo-express +ARG MONGO_EXPRESS_VERSION=release/v0.54.0 + +RUN set -eux; \ + apk add --no-cache --virtual .me-fetch-deps git; \ + git clone --depth 1 --branch "$MONGO_EXPRESS_VERSION" -c advice.detachedHead=false https://github.com/$MONGO_EXPRESS_REPOSITORY.git .; \ + export DISABLE_V8_COMPILE_CACHE=1; \ + yarn install; \ + yarn build; \ + yarn remove --all; \ + yarn workspaces focus --production; \ + yarn cache clean; \ + apk del --no-network .me-fetch-deps; \ + rm -rf .git* ~/.cache ~/.yarn + +# override some config defaults with values that will work better for docker +ENV ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" \ + ME_CONFIG_MONGODB_ENABLE_ADMIN="true" \ + ME_CONFIG_SITE_SESSIONSECRET="secret" \ + ME_CONFIG_BASICAUTH=true \ + VCAP_APP_HOST="0.0.0.0" + +EXPOSE 8081 +COPY docker-entrypoint.sh / +ENTRYPOINT [ "/sbin/tini", "--", "/docker-entrypoint.sh"] +CMD ["mongo-express"] diff --git a/0.54/20-alpine3.19/docker-entrypoint.sh b/0.54/20-alpine3.19/docker-entrypoint.sh new file mode 100755 index 0000000..df53c12 --- /dev/null +++ b/0.54/20-alpine3.19/docker-entrypoint.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# This file is auto-generated. Do not edit directly! +set -eo pipefail + +# if command does not start with mongo-express, run the command instead of the entrypoint +if [ "${1}" != "mongo-express" ]; then + exec "$@" +fi + +function wait_tcp_port { + local host="$1" port="$2" + local max_tries="$3" tries=1 + + # see http://tldp.org/LDP/abs/html/devref1.html for description of this syntax. + while ! exec 6<>/dev/tcp/$host/$port && [[ $tries -lt $max_tries ]]; do + sleep 1s + tries=$(( tries + 1 )) + echo "$(date) retrying to connect to $host:$port ($tries/$max_tries)" + done + exec 6>&- +} + +# if ME_CONFIG_MONGODB_URL has a comma in it, we're pointing to a replica set (https://github.com/mongo-express/mongo-express-docker/issues/21) +if [[ "$ME_CONFIG_MONGODB_URL" != *,* ]]; then + work=$ME_CONFIG_MONGODB_URL + # Remove the scheme (should be "mongodb://" or "mongodb+srv://"). + work=${work#*://} + # Remove the path component of the URL (should just be a "/"). + work=${work%%/*} + # Remove the userinfo. + work=${work#*@} + if [[ "$work" = *:* ]]; then + # Match the host. + host=${work%:*} + # Match the port. + port=${work#*:} + else + host=$work + port=27017 + fi + + # wait for the mongo server to be available + echo "Waiting for $host:$port..." + wait_tcp_port "$host" "$port" "${ME_CONFIG_CONNECT_RETRIES:-10}" +fi + +# run mongo-express +exec node app diff --git a/0.54/20-alpine3.20/Dockerfile b/0.54/20-alpine3.20/Dockerfile new file mode 100644 index 0000000..1a16f3d --- /dev/null +++ b/0.54/20-alpine3.20/Dockerfile @@ -0,0 +1,44 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +# https://nodejs.org/en/about/releases/ +# https://github.com/nodejs/Release#readme +FROM node:20-alpine3.20 + +RUN set -eux; \ + apk add --no-cache \ + bash \ + # grab tini for signal processing and zombie killing + tini + +WORKDIR /app + +ARG MONGO_EXPRESS_REPOSITORY=mongo-express/mongo-express +ARG MONGO_EXPRESS_VERSION=release/v0.54.0 + +RUN set -eux; \ + apk add --no-cache --virtual .me-fetch-deps git; \ + git clone --depth 1 --branch "$MONGO_EXPRESS_VERSION" -c advice.detachedHead=false https://github.com/$MONGO_EXPRESS_REPOSITORY.git .; \ + export DISABLE_V8_COMPILE_CACHE=1; \ + yarn install; \ + yarn build; \ + yarn remove --all; \ + yarn workspaces focus --production; \ + yarn cache clean; \ + apk del --no-network .me-fetch-deps; \ + rm -rf .git* ~/.cache ~/.yarn + +# override some config defaults with values that will work better for docker +ENV ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" \ + ME_CONFIG_MONGODB_ENABLE_ADMIN="true" \ + ME_CONFIG_SITE_SESSIONSECRET="secret" \ + ME_CONFIG_BASICAUTH=true \ + VCAP_APP_HOST="0.0.0.0" + +EXPOSE 8081 +COPY docker-entrypoint.sh / +ENTRYPOINT [ "/sbin/tini", "--", "/docker-entrypoint.sh"] +CMD ["mongo-express"] diff --git a/0.54/20-alpine3.20/docker-entrypoint.sh b/0.54/20-alpine3.20/docker-entrypoint.sh new file mode 100755 index 0000000..df53c12 --- /dev/null +++ b/0.54/20-alpine3.20/docker-entrypoint.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# This file is auto-generated. Do not edit directly! +set -eo pipefail + +# if command does not start with mongo-express, run the command instead of the entrypoint +if [ "${1}" != "mongo-express" ]; then + exec "$@" +fi + +function wait_tcp_port { + local host="$1" port="$2" + local max_tries="$3" tries=1 + + # see http://tldp.org/LDP/abs/html/devref1.html for description of this syntax. + while ! exec 6<>/dev/tcp/$host/$port && [[ $tries -lt $max_tries ]]; do + sleep 1s + tries=$(( tries + 1 )) + echo "$(date) retrying to connect to $host:$port ($tries/$max_tries)" + done + exec 6>&- +} + +# if ME_CONFIG_MONGODB_URL has a comma in it, we're pointing to a replica set (https://github.com/mongo-express/mongo-express-docker/issues/21) +if [[ "$ME_CONFIG_MONGODB_URL" != *,* ]]; then + work=$ME_CONFIG_MONGODB_URL + # Remove the scheme (should be "mongodb://" or "mongodb+srv://"). + work=${work#*://} + # Remove the path component of the URL (should just be a "/"). + work=${work%%/*} + # Remove the userinfo. + work=${work#*@} + if [[ "$work" = *:* ]]; then + # Match the host. + host=${work%:*} + # Match the port. + port=${work#*:} + else + host=$work + port=27017 + fi + + # wait for the mongo server to be available + echo "Waiting for $host:$port..." + wait_tcp_port "$host" "$port" "${ME_CONFIG_CONNECT_RETRIES:-10}" +fi + +# run mongo-express +exec node app diff --git a/0.54/22-alpine3.18/Dockerfile b/0.54/22-alpine3.18/Dockerfile new file mode 100644 index 0000000..842e412 --- /dev/null +++ b/0.54/22-alpine3.18/Dockerfile @@ -0,0 +1,44 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +# https://nodejs.org/en/about/releases/ +# https://github.com/nodejs/Release#readme +FROM node:22-alpine3.18 + +RUN set -eux; \ + apk add --no-cache \ + bash \ + # grab tini for signal processing and zombie killing + tini + +WORKDIR /app + +ARG MONGO_EXPRESS_REPOSITORY=mongo-express/mongo-express +ARG MONGO_EXPRESS_VERSION=release/v0.54.0 + +RUN set -eux; \ + apk add --no-cache --virtual .me-fetch-deps git; \ + git clone --depth 1 --branch "$MONGO_EXPRESS_VERSION" -c advice.detachedHead=false https://github.com/$MONGO_EXPRESS_REPOSITORY.git .; \ + export DISABLE_V8_COMPILE_CACHE=1; \ + yarn install; \ + yarn build; \ + yarn remove --all; \ + yarn workspaces focus --production; \ + yarn cache clean; \ + apk del --no-network .me-fetch-deps; \ + rm -rf .git* ~/.cache ~/.yarn + +# override some config defaults with values that will work better for docker +ENV ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" \ + ME_CONFIG_MONGODB_ENABLE_ADMIN="true" \ + ME_CONFIG_SITE_SESSIONSECRET="secret" \ + ME_CONFIG_BASICAUTH=true \ + VCAP_APP_HOST="0.0.0.0" + +EXPOSE 8081 +COPY docker-entrypoint.sh / +ENTRYPOINT [ "/sbin/tini", "--", "/docker-entrypoint.sh"] +CMD ["mongo-express"] diff --git a/0.54/22-alpine3.18/docker-entrypoint.sh b/0.54/22-alpine3.18/docker-entrypoint.sh new file mode 100755 index 0000000..df53c12 --- /dev/null +++ b/0.54/22-alpine3.18/docker-entrypoint.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# This file is auto-generated. Do not edit directly! +set -eo pipefail + +# if command does not start with mongo-express, run the command instead of the entrypoint +if [ "${1}" != "mongo-express" ]; then + exec "$@" +fi + +function wait_tcp_port { + local host="$1" port="$2" + local max_tries="$3" tries=1 + + # see http://tldp.org/LDP/abs/html/devref1.html for description of this syntax. + while ! exec 6<>/dev/tcp/$host/$port && [[ $tries -lt $max_tries ]]; do + sleep 1s + tries=$(( tries + 1 )) + echo "$(date) retrying to connect to $host:$port ($tries/$max_tries)" + done + exec 6>&- +} + +# if ME_CONFIG_MONGODB_URL has a comma in it, we're pointing to a replica set (https://github.com/mongo-express/mongo-express-docker/issues/21) +if [[ "$ME_CONFIG_MONGODB_URL" != *,* ]]; then + work=$ME_CONFIG_MONGODB_URL + # Remove the scheme (should be "mongodb://" or "mongodb+srv://"). + work=${work#*://} + # Remove the path component of the URL (should just be a "/"). + work=${work%%/*} + # Remove the userinfo. + work=${work#*@} + if [[ "$work" = *:* ]]; then + # Match the host. + host=${work%:*} + # Match the port. + port=${work#*:} + else + host=$work + port=27017 + fi + + # wait for the mongo server to be available + echo "Waiting for $host:$port..." + wait_tcp_port "$host" "$port" "${ME_CONFIG_CONNECT_RETRIES:-10}" +fi + +# run mongo-express +exec node app diff --git a/0.54/22-alpine3.19/Dockerfile b/0.54/22-alpine3.19/Dockerfile new file mode 100644 index 0000000..5d17030 --- /dev/null +++ b/0.54/22-alpine3.19/Dockerfile @@ -0,0 +1,44 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +# https://nodejs.org/en/about/releases/ +# https://github.com/nodejs/Release#readme +FROM node:22-alpine3.19 + +RUN set -eux; \ + apk add --no-cache \ + bash \ + # grab tini for signal processing and zombie killing + tini + +WORKDIR /app + +ARG MONGO_EXPRESS_REPOSITORY=mongo-express/mongo-express +ARG MONGO_EXPRESS_VERSION=release/v0.54.0 + +RUN set -eux; \ + apk add --no-cache --virtual .me-fetch-deps git; \ + git clone --depth 1 --branch "$MONGO_EXPRESS_VERSION" -c advice.detachedHead=false https://github.com/$MONGO_EXPRESS_REPOSITORY.git .; \ + export DISABLE_V8_COMPILE_CACHE=1; \ + yarn install; \ + yarn build; \ + yarn remove --all; \ + yarn workspaces focus --production; \ + yarn cache clean; \ + apk del --no-network .me-fetch-deps; \ + rm -rf .git* ~/.cache ~/.yarn + +# override some config defaults with values that will work better for docker +ENV ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" \ + ME_CONFIG_MONGODB_ENABLE_ADMIN="true" \ + ME_CONFIG_SITE_SESSIONSECRET="secret" \ + ME_CONFIG_BASICAUTH=true \ + VCAP_APP_HOST="0.0.0.0" + +EXPOSE 8081 +COPY docker-entrypoint.sh / +ENTRYPOINT [ "/sbin/tini", "--", "/docker-entrypoint.sh"] +CMD ["mongo-express"] diff --git a/0.54/22-alpine3.19/docker-entrypoint.sh b/0.54/22-alpine3.19/docker-entrypoint.sh new file mode 100755 index 0000000..df53c12 --- /dev/null +++ b/0.54/22-alpine3.19/docker-entrypoint.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# This file is auto-generated. Do not edit directly! +set -eo pipefail + +# if command does not start with mongo-express, run the command instead of the entrypoint +if [ "${1}" != "mongo-express" ]; then + exec "$@" +fi + +function wait_tcp_port { + local host="$1" port="$2" + local max_tries="$3" tries=1 + + # see http://tldp.org/LDP/abs/html/devref1.html for description of this syntax. + while ! exec 6<>/dev/tcp/$host/$port && [[ $tries -lt $max_tries ]]; do + sleep 1s + tries=$(( tries + 1 )) + echo "$(date) retrying to connect to $host:$port ($tries/$max_tries)" + done + exec 6>&- +} + +# if ME_CONFIG_MONGODB_URL has a comma in it, we're pointing to a replica set (https://github.com/mongo-express/mongo-express-docker/issues/21) +if [[ "$ME_CONFIG_MONGODB_URL" != *,* ]]; then + work=$ME_CONFIG_MONGODB_URL + # Remove the scheme (should be "mongodb://" or "mongodb+srv://"). + work=${work#*://} + # Remove the path component of the URL (should just be a "/"). + work=${work%%/*} + # Remove the userinfo. + work=${work#*@} + if [[ "$work" = *:* ]]; then + # Match the host. + host=${work%:*} + # Match the port. + port=${work#*:} + else + host=$work + port=27017 + fi + + # wait for the mongo server to be available + echo "Waiting for $host:$port..." + wait_tcp_port "$host" "$port" "${ME_CONFIG_CONNECT_RETRIES:-10}" +fi + +# run mongo-express +exec node app diff --git a/0.54/22-alpine3.20/Dockerfile b/0.54/22-alpine3.20/Dockerfile new file mode 100644 index 0000000..d8af4a2 --- /dev/null +++ b/0.54/22-alpine3.20/Dockerfile @@ -0,0 +1,44 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +# https://nodejs.org/en/about/releases/ +# https://github.com/nodejs/Release#readme +FROM node:22-alpine3.20 + +RUN set -eux; \ + apk add --no-cache \ + bash \ + # grab tini for signal processing and zombie killing + tini + +WORKDIR /app + +ARG MONGO_EXPRESS_REPOSITORY=mongo-express/mongo-express +ARG MONGO_EXPRESS_VERSION=release/v0.54.0 + +RUN set -eux; \ + apk add --no-cache --virtual .me-fetch-deps git; \ + git clone --depth 1 --branch "$MONGO_EXPRESS_VERSION" -c advice.detachedHead=false https://github.com/$MONGO_EXPRESS_REPOSITORY.git .; \ + export DISABLE_V8_COMPILE_CACHE=1; \ + yarn install; \ + yarn build; \ + yarn remove --all; \ + yarn workspaces focus --production; \ + yarn cache clean; \ + apk del --no-network .me-fetch-deps; \ + rm -rf .git* ~/.cache ~/.yarn + +# override some config defaults with values that will work better for docker +ENV ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" \ + ME_CONFIG_MONGODB_ENABLE_ADMIN="true" \ + ME_CONFIG_SITE_SESSIONSECRET="secret" \ + ME_CONFIG_BASICAUTH=true \ + VCAP_APP_HOST="0.0.0.0" + +EXPOSE 8081 +COPY docker-entrypoint.sh / +ENTRYPOINT [ "/sbin/tini", "--", "/docker-entrypoint.sh"] +CMD ["mongo-express"] diff --git a/0.54/22-alpine3.20/docker-entrypoint.sh b/0.54/22-alpine3.20/docker-entrypoint.sh new file mode 100755 index 0000000..df53c12 --- /dev/null +++ b/0.54/22-alpine3.20/docker-entrypoint.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# This file is auto-generated. Do not edit directly! +set -eo pipefail + +# if command does not start with mongo-express, run the command instead of the entrypoint +if [ "${1}" != "mongo-express" ]; then + exec "$@" +fi + +function wait_tcp_port { + local host="$1" port="$2" + local max_tries="$3" tries=1 + + # see http://tldp.org/LDP/abs/html/devref1.html for description of this syntax. + while ! exec 6<>/dev/tcp/$host/$port && [[ $tries -lt $max_tries ]]; do + sleep 1s + tries=$(( tries + 1 )) + echo "$(date) retrying to connect to $host:$port ($tries/$max_tries)" + done + exec 6>&- +} + +# if ME_CONFIG_MONGODB_URL has a comma in it, we're pointing to a replica set (https://github.com/mongo-express/mongo-express-docker/issues/21) +if [[ "$ME_CONFIG_MONGODB_URL" != *,* ]]; then + work=$ME_CONFIG_MONGODB_URL + # Remove the scheme (should be "mongodb://" or "mongodb+srv://"). + work=${work#*://} + # Remove the path component of the URL (should just be a "/"). + work=${work%%/*} + # Remove the userinfo. + work=${work#*@} + if [[ "$work" = *:* ]]; then + # Match the host. + host=${work%:*} + # Match the port. + port=${work#*:} + else + host=$work + port=27017 + fi + + # wait for the mongo server to be available + echo "Waiting for $host:$port..." + wait_tcp_port "$host" "$port" "${ME_CONFIG_CONNECT_RETRIES:-10}" +fi + +# run mongo-express +exec node app diff --git a/1.0/18-alpine3.20/Dockerfile b/1.0/18-alpine3.20/Dockerfile new file mode 100644 index 0000000..79236a8 --- /dev/null +++ b/1.0/18-alpine3.20/Dockerfile @@ -0,0 +1,44 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +# https://nodejs.org/en/about/releases/ +# https://github.com/nodejs/Release#readme +FROM node:18-alpine3.20 + +RUN set -eux; \ + apk add --no-cache \ + bash \ + # grab tini for signal processing and zombie killing + tini + +WORKDIR /app + +ARG MONGO_EXPRESS_REPOSITORY=mongo-express/mongo-express +ARG MONGO_EXPRESS_VERSION=release/v1.0.2 + +RUN set -eux; \ + apk add --no-cache --virtual .me-fetch-deps git; \ + git clone --depth 1 --branch "$MONGO_EXPRESS_VERSION" -c advice.detachedHead=false https://github.com/$MONGO_EXPRESS_REPOSITORY.git .; \ + export DISABLE_V8_COMPILE_CACHE=1; \ + yarn install; \ + yarn build; \ + yarn remove --all; \ + yarn workspaces focus --production; \ + yarn cache clean; \ + apk del --no-network .me-fetch-deps; \ + rm -rf .git* ~/.cache ~/.yarn + +# override some config defaults with values that will work better for docker +ENV ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" \ + ME_CONFIG_MONGODB_ENABLE_ADMIN="true" \ + ME_CONFIG_SITE_SESSIONSECRET="secret" \ + ME_CONFIG_BASICAUTH=true \ + VCAP_APP_HOST="0.0.0.0" + +EXPOSE 8081 +COPY docker-entrypoint.sh / +ENTRYPOINT [ "/sbin/tini", "--", "/docker-entrypoint.sh"] +CMD ["mongo-express"] diff --git a/1.0/18-alpine3.20/docker-entrypoint.sh b/1.0/18-alpine3.20/docker-entrypoint.sh new file mode 100755 index 0000000..df53c12 --- /dev/null +++ b/1.0/18-alpine3.20/docker-entrypoint.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# This file is auto-generated. Do not edit directly! +set -eo pipefail + +# if command does not start with mongo-express, run the command instead of the entrypoint +if [ "${1}" != "mongo-express" ]; then + exec "$@" +fi + +function wait_tcp_port { + local host="$1" port="$2" + local max_tries="$3" tries=1 + + # see http://tldp.org/LDP/abs/html/devref1.html for description of this syntax. + while ! exec 6<>/dev/tcp/$host/$port && [[ $tries -lt $max_tries ]]; do + sleep 1s + tries=$(( tries + 1 )) + echo "$(date) retrying to connect to $host:$port ($tries/$max_tries)" + done + exec 6>&- +} + +# if ME_CONFIG_MONGODB_URL has a comma in it, we're pointing to a replica set (https://github.com/mongo-express/mongo-express-docker/issues/21) +if [[ "$ME_CONFIG_MONGODB_URL" != *,* ]]; then + work=$ME_CONFIG_MONGODB_URL + # Remove the scheme (should be "mongodb://" or "mongodb+srv://"). + work=${work#*://} + # Remove the path component of the URL (should just be a "/"). + work=${work%%/*} + # Remove the userinfo. + work=${work#*@} + if [[ "$work" = *:* ]]; then + # Match the host. + host=${work%:*} + # Match the port. + port=${work#*:} + else + host=$work + port=27017 + fi + + # wait for the mongo server to be available + echo "Waiting for $host:$port..." + wait_tcp_port "$host" "$port" "${ME_CONFIG_CONNECT_RETRIES:-10}" +fi + +# run mongo-express +exec node app diff --git a/1.0/20-alpine3.20/Dockerfile b/1.0/20-alpine3.20/Dockerfile new file mode 100644 index 0000000..e238407 --- /dev/null +++ b/1.0/20-alpine3.20/Dockerfile @@ -0,0 +1,44 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +# https://nodejs.org/en/about/releases/ +# https://github.com/nodejs/Release#readme +FROM node:20-alpine3.20 + +RUN set -eux; \ + apk add --no-cache \ + bash \ + # grab tini for signal processing and zombie killing + tini + +WORKDIR /app + +ARG MONGO_EXPRESS_REPOSITORY=mongo-express/mongo-express +ARG MONGO_EXPRESS_VERSION=release/v1.0.2 + +RUN set -eux; \ + apk add --no-cache --virtual .me-fetch-deps git; \ + git clone --depth 1 --branch "$MONGO_EXPRESS_VERSION" -c advice.detachedHead=false https://github.com/$MONGO_EXPRESS_REPOSITORY.git .; \ + export DISABLE_V8_COMPILE_CACHE=1; \ + yarn install; \ + yarn build; \ + yarn remove --all; \ + yarn workspaces focus --production; \ + yarn cache clean; \ + apk del --no-network .me-fetch-deps; \ + rm -rf .git* ~/.cache ~/.yarn + +# override some config defaults with values that will work better for docker +ENV ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" \ + ME_CONFIG_MONGODB_ENABLE_ADMIN="true" \ + ME_CONFIG_SITE_SESSIONSECRET="secret" \ + ME_CONFIG_BASICAUTH=true \ + VCAP_APP_HOST="0.0.0.0" + +EXPOSE 8081 +COPY docker-entrypoint.sh / +ENTRYPOINT [ "/sbin/tini", "--", "/docker-entrypoint.sh"] +CMD ["mongo-express"] diff --git a/1.0/20-alpine3.20/docker-entrypoint.sh b/1.0/20-alpine3.20/docker-entrypoint.sh new file mode 100755 index 0000000..df53c12 --- /dev/null +++ b/1.0/20-alpine3.20/docker-entrypoint.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# This file is auto-generated. Do not edit directly! +set -eo pipefail + +# if command does not start with mongo-express, run the command instead of the entrypoint +if [ "${1}" != "mongo-express" ]; then + exec "$@" +fi + +function wait_tcp_port { + local host="$1" port="$2" + local max_tries="$3" tries=1 + + # see http://tldp.org/LDP/abs/html/devref1.html for description of this syntax. + while ! exec 6<>/dev/tcp/$host/$port && [[ $tries -lt $max_tries ]]; do + sleep 1s + tries=$(( tries + 1 )) + echo "$(date) retrying to connect to $host:$port ($tries/$max_tries)" + done + exec 6>&- +} + +# if ME_CONFIG_MONGODB_URL has a comma in it, we're pointing to a replica set (https://github.com/mongo-express/mongo-express-docker/issues/21) +if [[ "$ME_CONFIG_MONGODB_URL" != *,* ]]; then + work=$ME_CONFIG_MONGODB_URL + # Remove the scheme (should be "mongodb://" or "mongodb+srv://"). + work=${work#*://} + # Remove the path component of the URL (should just be a "/"). + work=${work%%/*} + # Remove the userinfo. + work=${work#*@} + if [[ "$work" = *:* ]]; then + # Match the host. + host=${work%:*} + # Match the port. + port=${work#*:} + else + host=$work + port=27017 + fi + + # wait for the mongo server to be available + echo "Waiting for $host:$port..." + wait_tcp_port "$host" "$port" "${ME_CONFIG_CONNECT_RETRIES:-10}" +fi + +# run mongo-express +exec node app diff --git a/1.0/22-alpine3.18/Dockerfile b/1.0/22-alpine3.18/Dockerfile new file mode 100644 index 0000000..52639ed --- /dev/null +++ b/1.0/22-alpine3.18/Dockerfile @@ -0,0 +1,44 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +# https://nodejs.org/en/about/releases/ +# https://github.com/nodejs/Release#readme +FROM node:22-alpine3.18 + +RUN set -eux; \ + apk add --no-cache \ + bash \ + # grab tini for signal processing and zombie killing + tini + +WORKDIR /app + +ARG MONGO_EXPRESS_REPOSITORY=mongo-express/mongo-express +ARG MONGO_EXPRESS_VERSION=release/v1.0.2 + +RUN set -eux; \ + apk add --no-cache --virtual .me-fetch-deps git; \ + git clone --depth 1 --branch "$MONGO_EXPRESS_VERSION" -c advice.detachedHead=false https://github.com/$MONGO_EXPRESS_REPOSITORY.git .; \ + export DISABLE_V8_COMPILE_CACHE=1; \ + yarn install; \ + yarn build; \ + yarn remove --all; \ + yarn workspaces focus --production; \ + yarn cache clean; \ + apk del --no-network .me-fetch-deps; \ + rm -rf .git* ~/.cache ~/.yarn + +# override some config defaults with values that will work better for docker +ENV ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" \ + ME_CONFIG_MONGODB_ENABLE_ADMIN="true" \ + ME_CONFIG_SITE_SESSIONSECRET="secret" \ + ME_CONFIG_BASICAUTH=true \ + VCAP_APP_HOST="0.0.0.0" + +EXPOSE 8081 +COPY docker-entrypoint.sh / +ENTRYPOINT [ "/sbin/tini", "--", "/docker-entrypoint.sh"] +CMD ["mongo-express"] diff --git a/1.0/22-alpine3.18/docker-entrypoint.sh b/1.0/22-alpine3.18/docker-entrypoint.sh new file mode 100755 index 0000000..df53c12 --- /dev/null +++ b/1.0/22-alpine3.18/docker-entrypoint.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# This file is auto-generated. Do not edit directly! +set -eo pipefail + +# if command does not start with mongo-express, run the command instead of the entrypoint +if [ "${1}" != "mongo-express" ]; then + exec "$@" +fi + +function wait_tcp_port { + local host="$1" port="$2" + local max_tries="$3" tries=1 + + # see http://tldp.org/LDP/abs/html/devref1.html for description of this syntax. + while ! exec 6<>/dev/tcp/$host/$port && [[ $tries -lt $max_tries ]]; do + sleep 1s + tries=$(( tries + 1 )) + echo "$(date) retrying to connect to $host:$port ($tries/$max_tries)" + done + exec 6>&- +} + +# if ME_CONFIG_MONGODB_URL has a comma in it, we're pointing to a replica set (https://github.com/mongo-express/mongo-express-docker/issues/21) +if [[ "$ME_CONFIG_MONGODB_URL" != *,* ]]; then + work=$ME_CONFIG_MONGODB_URL + # Remove the scheme (should be "mongodb://" or "mongodb+srv://"). + work=${work#*://} + # Remove the path component of the URL (should just be a "/"). + work=${work%%/*} + # Remove the userinfo. + work=${work#*@} + if [[ "$work" = *:* ]]; then + # Match the host. + host=${work%:*} + # Match the port. + port=${work#*:} + else + host=$work + port=27017 + fi + + # wait for the mongo server to be available + echo "Waiting for $host:$port..." + wait_tcp_port "$host" "$port" "${ME_CONFIG_CONNECT_RETRIES:-10}" +fi + +# run mongo-express +exec node app diff --git a/1.0/22-alpine3.19/Dockerfile b/1.0/22-alpine3.19/Dockerfile new file mode 100644 index 0000000..e95d3a4 --- /dev/null +++ b/1.0/22-alpine3.19/Dockerfile @@ -0,0 +1,44 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +# https://nodejs.org/en/about/releases/ +# https://github.com/nodejs/Release#readme +FROM node:22-alpine3.19 + +RUN set -eux; \ + apk add --no-cache \ + bash \ + # grab tini for signal processing and zombie killing + tini + +WORKDIR /app + +ARG MONGO_EXPRESS_REPOSITORY=mongo-express/mongo-express +ARG MONGO_EXPRESS_VERSION=release/v1.0.2 + +RUN set -eux; \ + apk add --no-cache --virtual .me-fetch-deps git; \ + git clone --depth 1 --branch "$MONGO_EXPRESS_VERSION" -c advice.detachedHead=false https://github.com/$MONGO_EXPRESS_REPOSITORY.git .; \ + export DISABLE_V8_COMPILE_CACHE=1; \ + yarn install; \ + yarn build; \ + yarn remove --all; \ + yarn workspaces focus --production; \ + yarn cache clean; \ + apk del --no-network .me-fetch-deps; \ + rm -rf .git* ~/.cache ~/.yarn + +# override some config defaults with values that will work better for docker +ENV ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" \ + ME_CONFIG_MONGODB_ENABLE_ADMIN="true" \ + ME_CONFIG_SITE_SESSIONSECRET="secret" \ + ME_CONFIG_BASICAUTH=true \ + VCAP_APP_HOST="0.0.0.0" + +EXPOSE 8081 +COPY docker-entrypoint.sh / +ENTRYPOINT [ "/sbin/tini", "--", "/docker-entrypoint.sh"] +CMD ["mongo-express"] diff --git a/1.0/22-alpine3.19/docker-entrypoint.sh b/1.0/22-alpine3.19/docker-entrypoint.sh new file mode 100755 index 0000000..df53c12 --- /dev/null +++ b/1.0/22-alpine3.19/docker-entrypoint.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# This file is auto-generated. Do not edit directly! +set -eo pipefail + +# if command does not start with mongo-express, run the command instead of the entrypoint +if [ "${1}" != "mongo-express" ]; then + exec "$@" +fi + +function wait_tcp_port { + local host="$1" port="$2" + local max_tries="$3" tries=1 + + # see http://tldp.org/LDP/abs/html/devref1.html for description of this syntax. + while ! exec 6<>/dev/tcp/$host/$port && [[ $tries -lt $max_tries ]]; do + sleep 1s + tries=$(( tries + 1 )) + echo "$(date) retrying to connect to $host:$port ($tries/$max_tries)" + done + exec 6>&- +} + +# if ME_CONFIG_MONGODB_URL has a comma in it, we're pointing to a replica set (https://github.com/mongo-express/mongo-express-docker/issues/21) +if [[ "$ME_CONFIG_MONGODB_URL" != *,* ]]; then + work=$ME_CONFIG_MONGODB_URL + # Remove the scheme (should be "mongodb://" or "mongodb+srv://"). + work=${work#*://} + # Remove the path component of the URL (should just be a "/"). + work=${work%%/*} + # Remove the userinfo. + work=${work#*@} + if [[ "$work" = *:* ]]; then + # Match the host. + host=${work%:*} + # Match the port. + port=${work#*:} + else + host=$work + port=27017 + fi + + # wait for the mongo server to be available + echo "Waiting for $host:$port..." + wait_tcp_port "$host" "$port" "${ME_CONFIG_CONNECT_RETRIES:-10}" +fi + +# run mongo-express +exec node app diff --git a/1.0/22-alpine3.20/Dockerfile b/1.0/22-alpine3.20/Dockerfile new file mode 100644 index 0000000..94770d8 --- /dev/null +++ b/1.0/22-alpine3.20/Dockerfile @@ -0,0 +1,44 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +# https://nodejs.org/en/about/releases/ +# https://github.com/nodejs/Release#readme +FROM node:22-alpine3.20 + +RUN set -eux; \ + apk add --no-cache \ + bash \ + # grab tini for signal processing and zombie killing + tini + +WORKDIR /app + +ARG MONGO_EXPRESS_REPOSITORY=mongo-express/mongo-express +ARG MONGO_EXPRESS_VERSION=release/v1.0.2 + +RUN set -eux; \ + apk add --no-cache --virtual .me-fetch-deps git; \ + git clone --depth 1 --branch "$MONGO_EXPRESS_VERSION" -c advice.detachedHead=false https://github.com/$MONGO_EXPRESS_REPOSITORY.git .; \ + export DISABLE_V8_COMPILE_CACHE=1; \ + yarn install; \ + yarn build; \ + yarn remove --all; \ + yarn workspaces focus --production; \ + yarn cache clean; \ + apk del --no-network .me-fetch-deps; \ + rm -rf .git* ~/.cache ~/.yarn + +# override some config defaults with values that will work better for docker +ENV ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" \ + ME_CONFIG_MONGODB_ENABLE_ADMIN="true" \ + ME_CONFIG_SITE_SESSIONSECRET="secret" \ + ME_CONFIG_BASICAUTH=true \ + VCAP_APP_HOST="0.0.0.0" + +EXPOSE 8081 +COPY docker-entrypoint.sh / +ENTRYPOINT [ "/sbin/tini", "--", "/docker-entrypoint.sh"] +CMD ["mongo-express"] diff --git a/1.0/22-alpine3.20/docker-entrypoint.sh b/1.0/22-alpine3.20/docker-entrypoint.sh new file mode 100755 index 0000000..df53c12 --- /dev/null +++ b/1.0/22-alpine3.20/docker-entrypoint.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# This file is auto-generated. Do not edit directly! +set -eo pipefail + +# if command does not start with mongo-express, run the command instead of the entrypoint +if [ "${1}" != "mongo-express" ]; then + exec "$@" +fi + +function wait_tcp_port { + local host="$1" port="$2" + local max_tries="$3" tries=1 + + # see http://tldp.org/LDP/abs/html/devref1.html for description of this syntax. + while ! exec 6<>/dev/tcp/$host/$port && [[ $tries -lt $max_tries ]]; do + sleep 1s + tries=$(( tries + 1 )) + echo "$(date) retrying to connect to $host:$port ($tries/$max_tries)" + done + exec 6>&- +} + +# if ME_CONFIG_MONGODB_URL has a comma in it, we're pointing to a replica set (https://github.com/mongo-express/mongo-express-docker/issues/21) +if [[ "$ME_CONFIG_MONGODB_URL" != *,* ]]; then + work=$ME_CONFIG_MONGODB_URL + # Remove the scheme (should be "mongodb://" or "mongodb+srv://"). + work=${work#*://} + # Remove the path component of the URL (should just be a "/"). + work=${work%%/*} + # Remove the userinfo. + work=${work#*@} + if [[ "$work" = *:* ]]; then + # Match the host. + host=${work%:*} + # Match the port. + port=${work#*:} + else + host=$work + port=27017 + fi + + # wait for the mongo server to be available + echo "Waiting for $host:$port..." + wait_tcp_port "$host" "$port" "${ME_CONFIG_CONNECT_RETRIES:-10}" +fi + +# run mongo-express +exec node app diff --git a/versions.json b/versions.json index 8d1a880..51595a5 100644 --- a/versions.json +++ b/versions.json @@ -1,10 +1,31 @@ { + "0.54": { + "alpine": "3.18", + "node": "18", + "variants": [ + "22-alpine3.20", + "22-alpine3.19", + "22-alpine3.18", + "20-alpine3.20", + "20-alpine3.19", + "20-alpine3.18", + "18-alpine3.20", + "18-alpine3.19", + "18-alpine3.18" + ], + "version": "0.54.0" + }, "1.0": { "alpine": "3.18", "node": "18", "variants": [ + "22-alpine3.20", + "22-alpine3.19", + "22-alpine3.18", + "20-alpine3.20", "20-alpine3.19", "20-alpine3.18", + "18-alpine3.20", "18-alpine3.19", "18-alpine3.18" ], diff --git a/versions.sh b/versions.sh index 0debbde..5f59222 100755 --- a/versions.sh +++ b/versions.sh @@ -2,10 +2,12 @@ set -Eeuo pipefail supportedNodeVersions=( + 22 20 18 ) supportedAlpineVersions=( + 3.20 3.19 3.18 )