Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove own entrypoint.d -- just use nginx' #6

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@ COPY /base /
RUN apk add --no-cache \
bash=~5 \
ca-certificates=~20240226 \
gnutls-utils=~3 \
tini=~0
gnutls-utils=~3

ARG workdir=/var/www
WORKDIR "${workdir}"

SHELL ["/bin/ash", "-eo", "pipefail", "-c"]

ENTRYPOINT [ "/sbin/tini", "--", "/usr/local/bin/entrypoint" ]
CMD [ "nginx", "-g", "daemon off;" ]

##
# Drupal
##
Expand Down
4 changes: 4 additions & 0 deletions context/base/docker-entrypoint.d/10-first-virtual-host.envsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# shellcheck shell=sh

FIRST_VIRTUAL_HOST=$(echo "${VIRTUAL_HOST:-localhost}" | awk '{print $1;}')
export FIRST_VIRTUAL_HOST
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
#!/usr/bin/env bash
# shellcheck shell=sh

set -euo pipefail

FIRST_VIRTUAL_HOST=$(awk '{print $1;}' <<<"${VIRTUAL_HOST:-localhost}")
export FIRST_VIRTUAL_HOST

echo "export FIRST_VIRTUAL_HOST=${FIRST_VIRTUAL_HOST}" >>/docker-entrypoint.d/10-first_virtual_host.envsh
chmod +x /docker-entrypoint.d/10-first_virtual_host.envsh

mkdir -p /cert
mkdir -p /cert /etc/nginx/include.d

CERT="/cert/${FIRST_VIRTUAL_HOST:-localhost}.crt"
CERT_KEY="/cert/${FIRST_VIRTUAL_HOST:-localhost}.key"
CA_CERT="/rootCA/rootCA.pem"
CA_KEY="/rootCA/rootCA-key.pem"

# if [ ! -r "${CA_CERT}" ] || [ ! -r "${CA_KEY}" ]; then
# echo "No root certificate, skipping certificate generation"
# exit 0
# fi

IP_ADDRESS=$(hostname -i)
export IP_ADDRESS

Expand All @@ -43,5 +30,4 @@ if [ -r "${CA_CERT}" ]; then
/usr/sbin/update-ca-certificates
fi

mkdir -p /etc/nginx/include.d
envsubst </etc/ssl.conf.template >/etc/nginx/include.d/ssl.conf
5 changes: 0 additions & 5 deletions context/base/usr/local/bin/entrypoint

This file was deleted.